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

Class Solution

src/com/blankj/easy/_0119/Solution.java:15–31  ·  view source on GitHub ↗

author: Blankj blog : http://blankj.com time : 2017/10/11 desc :

Source from the content-addressed store, hash-verified

13 * </pre>
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();
29 System.out.println(solution.getRow(5));
30 }
31}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected