01 2017 档案

摘要:219. Contains Duplicate II 219. Contains Duplicate II Given an array of integers and an integer k, find out whether there are two distinct indices i a 阅读全文
posted @ 2017-01-21 23:39 rocksolid 阅读(154) 评论(0) 推荐(0)
摘要:Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 阅读全文
posted @ 2017-01-17 14:36 rocksolid 阅读(92) 评论(0) 推荐(0)
摘要:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2017-01-17 13:28 rocksolid 阅读(150) 评论(0) 推荐(0)
摘要:Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element i 阅读全文
posted @ 2017-01-16 16:09 rocksolid 阅读(115) 评论(0) 推荐(0)
摘要:Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the 阅读全文
posted @ 2017-01-16 12:41 rocksolid 阅读(117) 评论(0) 推荐(0)
摘要:Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
posted @ 2017-01-16 10:43 rocksolid 阅读(112) 评论(0) 推荐(0)
摘要:Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 阅读全文
posted @ 2017-01-12 16:51 rocksolid 阅读(132) 评论(0) 推荐(0)
摘要:Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s 阅读全文
posted @ 2017-01-12 15:55 rocksolid 阅读(128) 评论(0) 推荐(0)
摘要:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11.11 is read off 阅读全文
posted @ 2017-01-11 14:14 rocksolid 阅读(105) 评论(0) 推荐(0)
摘要:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2017-01-10 11:42 rocksolid 阅读(142) 评论(0) 推荐(0)
摘要:Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 1 2 brute force 3 hash 有 阅读全文
posted @ 2017-01-05 17:06 rocksolid 阅读(113) 评论(0) 推荐(0)
摘要:Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2017-01-05 16:53 rocksolid 阅读(114) 评论(0) 推荐(0)
摘要:24. Swap Nodes in Pairs 24. Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, 阅读全文
posted @ 2017-01-05 15:55 rocksolid 阅读(97) 评论(0) 推荐(0)