![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 80
七尺草民
这个作者很懒,什么都没留下…
展开
-
leetcode---3.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 only O(k) extra space? 帕斯卡三角即是杨辉三角。这个问题原创 2015-04-21 20:11:19 · 428 阅读 · 0 评论 -
leetcode---2.Reverse Bits
问题描述:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary a原创 2015-04-21 19:51:11 · 512 阅读 · 0 评论 -
leetcode--TWO SUM延伸(假设答案不唯一、假设输入有相同数字)
leetcode中的TWO SUM对结果进行了限制,You may assume that each input would have exactly one solution.但是考虑实际情况,有可能在数列中,有多个组合的sum等于target。需要找到所有的情况。1, 假设:在输入的数列中没有重复的数字,结果中数对不唯一sort之后不跳出循环,接着寻找对应的数对。直到寻找完v原创 2015-07-14 21:29:56 · 1735 阅读 · 0 评论 -
leetcode---1.Two sum
Question:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target,原创 2015-03-31 16:52:45 · 325 阅读 · 0 评论