随笔分类 -  LeetCode

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

LeetCode: Palindrome Partitioning II 解题报告
摘要: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 阅读(964) 评论(0) 推荐(0) 编辑

LeetCode: Jump Game II 解题报告
摘要: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 阅读(2385) 评论(0) 推荐(0) 编辑

LeetCode: Triangle 解题报告
摘要: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 阅读(802) 评论(0) 推荐(0) 编辑

LeetCode: Merge k Sorted Lists 解题报告
摘要: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 阅读(1054) 评论(0) 推荐(0) 编辑

LeetCode: Partition List 解题报告
摘要: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 阅读(417) 评论(0) 推荐(0) 编辑

LeetCode: Binary Tree Inorder Traversal 解题报告
摘要: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 阅读(468) 评论(0) 推荐(0) 编辑

LeetCode: Binary Tree Preorder Traversal 解题报告
摘要: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 阅读(2367) 评论(0) 推荐(1) 编辑

LeetCode: Symmetric Tree 解题报告
摘要: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 阅读(683) 评论(0) 推荐(0) 编辑

LeetCode: isSameTree1 解题报告
摘要: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 阅读(408) 评论(0) 推荐(0) 编辑

LeetCode: Combination Sum II 解题报告
摘要: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 阅读(1090) 评论(0) 推荐(0) 编辑

LeetCode: Combination Sum 解题报告
摘要: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 阅读(972) 评论(1) 推荐(1) 编辑

LeetCode: Letter Combinations of a Phone Number 解题报告
摘要: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 阅读(1726) 评论(0) 推荐(0) 编辑

LeetCode: Permutations II 解题报告
摘要: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 阅读(2937) 评论(0) 推荐(0) 编辑

LeetCode: Permutations 解题报告
摘要: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 阅读(1089) 评论(0) 推荐(0) 编辑

LeetCode: Combinations 解题报告
摘要: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 阅读(927) 评论(0) 推荐(0) 编辑

LeetCode: Reverse Words in a String 解题报告
摘要: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 阅读(583) 评论(0) 推荐(0) 编辑

LeetCode: Median of Two Sorted Arrays 解题报告
摘要: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 阅读(7662) 评论(0) 推荐(2) 编辑

LeetCode: Linked List Cycle 解题报告
摘要: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 阅读(561) 评论(0) 推荐(0) 编辑

LeetCode: Rotate List 解题报告
摘要: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 阅读(485) 评论(0) 推荐(0) 编辑

LeetCode: Surrounded Regions 解题报告
摘要: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 阅读(1169) 评论(0) 推荐(0) 编辑

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

导航