MCPcopy Create free account
hub / github.com/HuberTRoy/leetCode / Solution

Class Solution

Array/Pascal's TriangleI_II.py:38–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36"""
37# I
38class 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):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected