摘要: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.... 阅读全文
posted @ 2014-05-17 23:14 linyx 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word ... 阅读全文
posted @ 2014-05-17 21:45 linyx 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文
posted @ 2014-05-17 19:37 linyx 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2014-05-17 16:11 linyx 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Remove Duplicates from Sorted List IGiven a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->... 阅读全文
posted @ 2014-05-17 14:46 linyx 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2014-05-17 13:40 linyx 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then le... 阅读全文
posted @ 2014-05-17 13:18 linyx 阅读(128) 评论(0) 推荐(0) 编辑