Skip to content

Commit 3ea1ac0

Browse files
August: Day 12
1 parent 9be73d1 commit 3ea1ac0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

LeetCode/Pascal's Triangle ii.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public:
3+
vector<int> getRow(int rowIndex) {
4+
vector<int> ret(rowIndex+1);
5+
ret[0] = 1;
6+
for(int i=1; i<rowIndex+1; ++i)
7+
for(int j=i; j>=1; --j)
8+
ret[j] += ret[j-1];
9+
return ret;
10+
}
11+
};

0 commit comments

Comments
 (0)