We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6d1f102 commit cd17ac2Copy full SHA for cd17ac2
src/main/java/com/fishercoder/solutions/_119.java
@@ -43,7 +43,7 @@ public static class Solution2 {
43
/** O(k) space */
44
public List<Integer> getRow(int rowIndex) {
45
List<Integer> row = new ArrayList<>();
46
- for (int i = 0; i < rowIndex + 1; i++) {
+ for (int i = 0; i <= rowIndex; i++) {
47
row.add(0, 1);
48
for (int j = 1; j < row.size() - 1; j++) {
49
row.set(j, row.get(j) + row.get(j + 1));
0 commit comments