
动规
最大的敌人是自己
欢迎大牛指点
展开
-
118.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]]我的解决思路: 第n行的元素个数为n,就想到了数字三角,可原创 2016-04-21 10:03:47 · 279 阅读 · 0 评论 -
53. Maximum Subarray
题目描述: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,−1,2,1]原创 2016-04-22 18:15:03 · 314 阅读 · 0 评论