Skip to content

Commit 0101f52

Browse files
committed
1
1 parent 176282c commit 0101f52

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Pascal'sTriangle/Pascal'sTriangle.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ class Solution {
33
vector<vector<int> > generate(int numRows) {
44
// Start typing your C/C++ solution below
55
// DO NOT write int main() function
6+
67
vector<vector<int>> triangle(numRows);
8+
79
if (numRows == 0)
810
return triangle;
11+
912
triangle[0].push_back(1);
13+
1014
for (int i = 1; i < numRows; i++) {
1115
triangle[i].push_back(1);
1216
for (int j = 1; j < i; j++) {
@@ -16,4 +20,4 @@ class Solution {
1620
}
1721
return move(triangle);
1822
}
19-
};
23+
};

0 commit comments

Comments
 (0)