摘要:Palindrome Partitioning IIGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for ...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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....
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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 ...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:Combination SumCombination Sum Total Accepted: 25850 Total Submissions: 96391 My Submissions Question Solution Given a set of candidate numbers (C) an...
阅读全文
摘要:Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit ...
阅读全文
摘要:Permutations IIGiven a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the follo...
阅读全文
摘要: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...
阅读全文
摘要: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:[ [...
阅读全文
摘要: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...
阅读全文
摘要: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
阅读全文
摘要: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:经典快慢指针问题。如果存在环...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文