| 36 | """ |
| 37 | # I |
| 38 | class Solution(object): |
| 39 | def generate(self, numRows): |
| 40 | """ |
| 41 | :type numRows: int |
| 42 | :rtype: List[List[int]] |
| 43 | """ |
| 44 | result = [] |
| 45 | |
| 46 | for i in range(1, numRows+1): |
| 47 | x = [0 for j in range(i)] |
| 48 | x[0] = 1 |
| 49 | x[-1] = 1 |
| 50 | for j in range(1, i-1): |
| 51 | x[j] = result[-1][j] + result[-1][j-1] |
| 52 | |
| 53 | result.append(x) |
| 54 | |
| 55 | return result |
| 56 | |
| 57 | # II |
| 58 | class Solution(object): |
nothing calls this directly
no outgoing calls
no test coverage detected