MCPcopy Create free account
hub / github.com/Blankj/awesome-java-leetcode / getRow

Method getRow

src/com/blankj/easy/_0119/Solution.java:16–25  ·  view source on GitHub ↗
(int rowIndex)

Source from the content-addressed store, hash-verified

14 */
15public class Solution {
16 public List<Integer> getRow(int rowIndex) {
17 List<Integer> res = new ArrayList<>();
18 for (int i = 0; i <= rowIndex; ++i) {
19 res.add(1);
20 for (int j = i - 1; j > 0; --j) {
21 res.set(j, res.get(j - 1) + res.get(j));
22 }
23 }
24 return res;
25 }
26
27 public static void main(String[] args) {
28 Solution solution = new Solution();

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected