摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with con... 阅读全文
posted @ 2017-03-01 23:41 xiejunzhao 阅读(129) 评论(0) 推荐(0)
摘要: 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?题意:计算杨辉三角的某一行,要求空间复杂度为O(k)pu... 阅读全文
posted @ 2017-03-01 23:40 xiejunzhao 阅读(83) 评论(0) 推荐(0)