- 博客(7)
- 资源 (1)
- 收藏
- 关注
原创 [leetcode]Trapping Rain Water
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. For example, Given [0,1,0,2,1,0,1,3,2,1,2,1],
2015-04-24 23:19:09
309
原创 [leetcode]Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,−1,2,1] has the
2015-04-22 19:51:58
384
原创 [leetcode]single number
题目:Given an array of integers, every element appears twice except for one. Find that single one.这题的标签是hash table和bit manipulation,首先想到bit manipulation的思路,由于一个整型数和自己的异或操作得到是全零,全零和任何整型异或都不会改变整型的
2015-04-18 15:41:04
334
原创 [leetcode]Unique Binary Search Trees
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1
2015-04-13 15:21:43
279
原创 [leetcode]Largest Number
题目如下:Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result may be very l
2015-04-11 23:28:23
403
原创 C++ lambda 表达式
1. 我们可以传递任何种callable object给算法,一个object或者expression 称为callable 是因为我们可以应用call operator。我们说e是一个callable expression,那么我们可以写这样的代码: e(arg);arg是用逗号隔开的argument list。2. callable:function,funct
2015-04-10 20:09:40
373
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人