摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2017-02-14 10:59 notesbuddy 阅读(412) 评论(0) 推荐(0) 编辑
摘要: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and k = 2, a solution is: 阅读全文
posted @ 2017-02-14 01:59 notesbuddy 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho 阅读全文
posted @ 2017-02-14 01:40 notesbuddy 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations: 阅读全文
posted @ 2017-02-13 15:45 notesbuddy 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: The solution set must not contain duplicate sub 阅读全文
posted @ 2017-02-10 19:59 notesbuddy 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given a set of distinct integers, nums, return all possible subsets. Note: The solution set must not contain duplicate subsets. For example,If nums =  阅读全文
posted @ 2017-02-10 19:49 notesbuddy 阅读(119) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh 阅读全文
posted @ 2017-02-08 22:26 notesbuddy 阅读(171) 评论(0) 推荐(0) 编辑
摘要: String to Integer (atoi) Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, 阅读全文
posted @ 2017-02-08 14:16 notesbuddy 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes? 阅读全文
posted @ 2017-02-08 11:00 notesbuddy 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings. 思路: 逐个遍历 第一趟: 第一个子串与第二个子串 求prefix。 备注。 prefix的最大长度等于两个子串中最短的字符串 阅读全文
posted @ 2017-02-08 10:44 notesbuddy 阅读(117) 评论(0) 推荐(0) 编辑