Leetcode
Peihong Yu
这个作者很懒,什么都没留下…
展开
-
【Leetcode】118. Pascal's Triangle
Pascal’s Triangle: Given numRows, generate the first numRows of Pascal’s triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,原创 2016-01-22 16:06:06 · 341 阅读 · 0 评论 -
【Leetcode】119. Pascal's Triangle II
119. 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]. Note: Could you optimize your algorithm to use onl原创 2016-01-22 16:20:12 · 293 阅读 · 0 评论 -
【Leetcode】217. Contains Duplicate
217. Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return原创 2016-01-22 16:26:11 · 387 阅读 · 0 评论 -
【Leetcode】219. Contains Duplicate II
219. Contains Duplicate II Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i a原创 2016-01-22 16:29:10 · 350 阅读 · 0 评论 -
【Leetcode】67. Add Binary
注:string转int:atoi(str.c_str())int转string:to_string(num)int,long,long long取值范围:unsigned int 0~4294967295 int 2147483648~2147483647-unsigned long 0~4294967295long 2147483648~2147483647原创 2016-01-25 11:56:55 · 439 阅读 · 0 评论