随笔分类 -  LeetCode

上一页 1 2 3 4 5 6 7 下一页

摘要:Palindrome Partitioning IIGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for ... 阅读全文

posted @ 2014-12-06 22:28 Yu's Garden 阅读(979) 评论(0) 推荐(0)

摘要:Jump Game II Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represent... 阅读全文

posted @ 2014-12-06 21:59 Yu's Garden 阅读(2398) 评论(0) 推荐(0)

摘要:Triangle Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, give... 阅读全文

posted @ 2014-12-06 04:02 Yu's Garden 阅读(813) 评论(0) 推荐(0)

摘要:Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Show Tags参考资料: http://blog.csdn.... 阅读全文

posted @ 2014-12-05 10:37 Yu's Garden 阅读(1062) 评论(0) 推荐(0)

摘要:Partition List Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should... 阅读全文

posted @ 2014-12-04 19:13 Yu's Garden 阅读(422) 评论(0) 推荐(0)

摘要:Binary Tree Inorder TraversalGiven a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3... 阅读全文

posted @ 2014-12-03 23:03 Yu's Garden 阅读(477) 评论(0) 推荐(0)

摘要:Binary Tree Preorder Traversal Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 ... 阅读全文

posted @ 2014-12-03 22:32 Yu's Garden 阅读(2380) 评论(0) 推荐(1)

摘要:Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric... 阅读全文

posted @ 2014-12-03 22:13 Yu's Garden 阅读(691) 评论(0) 推荐(0)

摘要:isSameTree1Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally i... 阅读全文

posted @ 2014-12-03 22:08 Yu's Garden 阅读(420) 评论(0) 推荐(0)

摘要:Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers s... 阅读全文

posted @ 2014-12-03 21:29 Yu's Garden 阅读(1095) 评论(0) 推荐(0)

摘要:Combination SumCombination Sum Total Accepted: 25850 Total Submissions: 96391 My Submissions Question Solution Given a set of candidate numbers (C) an... 阅读全文

posted @ 2014-12-03 20:39 Yu's Garden 阅读(981) 评论(1) 推荐(1)

摘要:Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit ... 阅读全文

posted @ 2014-12-03 20:14 Yu's Garden 阅读(1740) 评论(0) 推荐(0)

摘要:Permutations IIGiven a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the follo... 阅读全文

posted @ 2014-12-03 19:56 Yu's Garden 阅读(2954) 评论(0) 推荐(0)

摘要:PermutationsGiven a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1... 阅读全文

posted @ 2014-12-03 19:01 Yu's Garden 阅读(1101) 评论(0) 推荐(0)

摘要:CombinationsGiven 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 @ 2014-12-03 18:44 Yu's Garden 阅读(942) 评论(0) 推荐(0)

摘要:Reverse Words in a String Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".clic... 阅读全文

posted @ 2014-12-03 16:40 Yu's Garden 阅读(594) 评论(0) 推荐(0)

摘要:Median of Two Sorted Arrays There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall ru 阅读全文

posted @ 2014-12-02 18:28 Yu's Garden 阅读(7693) 评论(0) 推荐(2)

摘要:Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?SOLUTION 1:经典快慢指针问题。如果存在环... 阅读全文

posted @ 2014-11-29 23:21 Yu's Garden 阅读(567) 评论(0) 推荐(0)

摘要:Rotate ListGiven a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5... 阅读全文

posted @ 2014-11-29 23:11 Yu's Garden 阅读(496) 评论(0) 推荐(0)

摘要:Surrounded RegionsGiven a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's i... 阅读全文

posted @ 2014-11-29 22:08 Yu's Garden 阅读(1181) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 下一页

导航