array
胡啦啦
这个作者很懒,什么都没留下…
展开
-
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] ]自己没有想到很好的解法,看了solution,被其代码惊呆了,原创 2017-03-09 21:41:25 · 250 阅读 · 0 评论 -
Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.Here原创 2017-03-07 00:38:14 · 176 阅读 · 0 评论 -
Pascal's Triangle II
Total Accepted: 105799 Total Submissions: 297504 Difficulty: Easy Contributors: Admin Given an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].Note:原创 2017-03-10 00:50:58 · 275 阅读 · 0 评论 -
Third Maximum Number
Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1: Input: [3, 2, 1] Ou原创 2017-03-10 01:16:15 · 284 阅读 · 0 评论