We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e3400a commit 1fe241aCopy full SHA for 1fe241a
solution/0119.Pascal's Triangle II/Solution.java
@@ -0,0 +1,11 @@
1
+class Solution {
2
+ public List<Integer> getRow(int rowIndex) {
3
+ List<Integer> ret = new LinkedList<>();
4
+ long nk = 1;
5
+ for (int i = 0; i <= rowIndex; i++) {
6
+ ret.add((int) nk);
7
+ nk = nk * (rowIndex - i) / (i + 1);
8
+ }
9
+ return ret;
10
11
+}
0 commit comments