
代码练习
文章平均质量分 59
Basaly
产品经理
展开
-
Remove Element
题目:Given an array and a value, remove all instances of that > value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.原创 2017-03-29 23:58:24 · 380 阅读 · 0 评论 -
Remove Duplicates from Sorted Array
题目:Given a sorted array, remove the duplicates in place such that > each element appear only onceand return the new length.Do not allocate extra space for another array, you must do this in plac原创 2017-03-30 00:39:27 · 222 阅读 · 0 评论 -
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,6,4,1]]要得到一个帕斯卡三角,我们只需要找到规律即可。第k层有k个元素每层原创 2017-03-31 23:10:54 · 183 阅读 · 0 评论 -
Merge Sorted Array
题目:Given two sorted integer arrays A and B, merge B into A as one sorted array.Note: You may assume that A has enough space (size that is greater or equal to m + n) to holdadditional elements fr原创 2017-03-31 23:32:04 · 284 阅读 · 0 评论