- 博客(4)
- 收藏
- 关注
原创 leetcode 119. Pascal's Triangle II 解法讨论
这个题关键是注意第二个循环,必须倒序的修改杨辉三角的值,不能顺序的改。C++解法时间复杂度O(n^2),空间复杂度O(k) 耗时0msclass Solution { public: vector<int> getRow(int rowIndex) { vector<int> array; for (int i = 0; i <= rowIndex; i++)
2016-12-01 00:24:52
352
原创 leetcode 1. Two Sum 解法讨论
题目内容如下: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution. Example: Given nums
2016-11-28 23:23:52
275
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅