2014年12月20日

[leetcode] Trapping Rain Water

摘要: Trapping Rain WaterGivennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to tr... 阅读全文

posted @ 2014-12-20 16:32 cha1992 阅读(120) 评论(0) 推荐(0) 编辑

[leetcode] Longest Consecutive Sequence

摘要: Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4... 阅读全文

posted @ 2014-12-20 15:49 cha1992 阅读(120) 评论(0) 推荐(0) 编辑

2014年12月18日

Spiral Matrix I II

摘要: Spiral MatrixGiven a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[... 阅读全文

posted @ 2014-12-18 22:31 cha1992 阅读(118) 评论(0) 推荐(0) 编辑

2014年12月16日

[leetcode] Sum Root to Leaf Numbers

摘要: Sum Root to Leaf NumbersGiven a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-l... 阅读全文

posted @ 2014-12-16 15:54 cha1992 阅读(160) 评论(0) 推荐(0) 编辑

[leetcode] Combinations

摘要: CombinationsGiven two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3... 阅读全文

posted @ 2014-12-16 15:25 cha1992 阅读(98) 评论(0) 推荐(0) 编辑

2014年12月15日

Binary Tree Level Order Traversal I II

摘要: Binary Tree Level Order TraversalGiven a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).Fo... 阅读全文

posted @ 2014-12-15 17:21 cha1992 阅读(109) 评论(0) 推荐(0) 编辑

2014年12月12日

[leetcode] Remove Duplicates from Sorted Array I II

摘要: Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new lengt... 阅读全文

posted @ 2014-12-12 10:27 cha1992 阅读(158) 评论(0) 推荐(0) 编辑

2014年12月11日

[leetcode] Minimum Path Sum

摘要: Minimum Path SumGiven amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along ... 阅读全文

posted @ 2014-12-11 11:05 cha1992 阅读(101) 评论(0) 推荐(0) 编辑

2014年12月10日

[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 follow... 阅读全文

posted @ 2014-12-10 12:54 cha1992 阅读(124) 评论(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,3]... 阅读全文

posted @ 2014-12-10 10:41 cha1992 阅读(138) 评论(0) 推荐(0) 编辑

导航