LeetCode-119.杨辉三角II(相关话题:数组)
2018-10-19 19:50
253 查看
Java代码:
[code]class Solution { public List<Integer> getRow(int rowIndex) { List<Integer> res = new ArrayList<>(rowIndex+1); for(int i = 0; i <= rowIndex; i++){ res.add(1); for(int j = i-1; j > 0; j--){ res.set(j, res.get(j) + res.get(j-1)); } } return res; } }阅读更多
相关文章推荐
- leetcode_数组_相关内容_1(48-66-88-118-119)
- LeetCode-125.验证回文串(相关话题:字符串)
- [leetcode] 根据String数组构造TreeNode,用于LeetCode树结构相关的测试用例
- LeetCode-121.买卖股票的最佳时机(相关话题:动态规划)
- LeetCode-122.买卖股票的最佳时机II(相关话题:贪心算法)
- LeetCode-123.买卖股票的最佳时机III(相关话题:动态规划)
- LeetCode-126.单词接龙II(相关话题:Dijkstra算法+深度优先)
- LeetCode-127.单词接龙(相关话题:广度优先)
- ※ Leetcode - Dynamic Programming - 119. Pascal's Triangle II(倒叙滚动数组求解杨辉三角第k行)
- leetcode_数组_相关内容2(
- (数组)leetcode 119:Pascal's Triangle II
- Leetcode:119. Pascal's Triangle II(JAVA)
- Leetcode 119. Pascal's Triangle II 杨辉三角2 解题报告
- [LeetCode] 152. Maximum Product Subarray 求最大子数组乘积
- 指针与数组、函数、结构体等之间相关问题
- Shell中数组相关问题
- [LeetCode] Merge Sorted Array 混合插入有序数组
- 编写一个使用数组类模板Array对数组进行排序、求最大值和求元素和的程序,并采用相关数据进行测试。