File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
2025-08-August-LeetCoding-Challenge Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 1+ class Solution :
2+ def generate (self , numRows : int ) -> list [list [int ]]:
3+ triangle = [[1 ]]
4+ for i in range (1 , numRows ):
5+ row = [1 ]
6+ for j in range (1 , i ):
7+ row .append (triangle [i - 1 ][j - 1 ] + triangle [i - 1 ][j ])
8+ row .append (1 )
9+ triangle .append (row )
10+ return triangle
11+
12+
13+ def main ():
14+ assert Solution ().generate (5 ) == [[1 ],
15+ [1 , 1 ],
16+ [1 , 2 , 1 ],
17+ [1 , 3 , 3 , 1 ],
18+ [1 , 4 , 6 , 4 , 1 ]]
19+
20+ assert Solution ().generate (1 ) == [[1 ]]
21+
22+
23+ if __name__ == '__main__' :
24+ main ()
Original file line number Diff line number Diff line change 44## Questions
55| Day | Problem | Level | Status |
66| --- | --- | --- | --- |
7- | August 01 | [ ] ( ) | | |
7+ | August 01 | [ 118. Pascal's Triangle ] ( https://leetcode.com/problems/pascals-triangle/ ) | Easy | Solved |
88| August 02 | [ ] ( ) | | |
99| August 03 | [ ] ( ) | | |
1010| August 04 | [ ] ( ) | | |
4040## Summary
4141| Level | Problems | Solved | Unsolved |
4242| --- | --- | --- | --- |
43- | Easy | 0 | 0 | 0 |
43+ | Easy | 1 | 1 | 0 |
4444| Medium | 0 | 0 | 0 |
4545| Hard | 0 | 0 | 0 |
You can’t perform that action at this time.
0 commit comments