[LeetCode] Permutations II 解题报告

摘要: Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique per... 阅读全文
posted @ 2012-12-30 06:35 小刀初试 阅读(136) 评论(0) 推荐(0)

[LeetCode] Permutations 解题报告

摘要: Given 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,3], [2,3,1]... 阅读全文
posted @ 2012-12-30 05:32 小刀初试 阅读(152) 评论(0) 推荐(0)

[LeetCode] Path Sum II 解题报告

摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum ... 阅读全文
posted @ 2012-12-30 04:55 小刀初试 阅读(161) 评论(0) 推荐(0)

[LeetCode] Pascal's Triangle II 解题报告

摘要: Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].[ [1], [1,1], [1,2,1], [1,3,3,1], [1... 阅读全文
posted @ 2012-12-29 13:15 小刀初试 阅读(151) 评论(0) 推荐(0)

[LeetCode] 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 preserve the o... 阅读全文
posted @ 2012-12-29 12:51 小刀初试 阅读(138) 评论(0) 推荐(0)

[LeetCode] Palindrome Number 解题报告

摘要: Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinki... 阅读全文
posted @ 2012-12-29 12:26 小刀初试 阅读(155) 评论(0) 推荐(0)

[LeetCode] Next Permutation 解题报告

摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
posted @ 2012-12-28 13:46 小刀初试 阅读(176) 评论(0) 推荐(0)

[LeetCode] Multiply Strings 解题报告

摘要: Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega... 阅读全文
posted @ 2012-12-28 12:59 小刀初试 阅读(120) 评论(0) 推荐(0)

[LeetCode] Minimum Window Substring 解题报告

摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODE... 阅读全文
posted @ 2012-12-28 10:49 小刀初试 阅读(197) 评论(0) 推荐(0)

[LeetCode] Minimum Path Sum 解题报告

摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.N... 阅读全文
posted @ 2012-12-28 07:24 小刀初试 阅读(203) 评论(0) 推荐(0)