class Solution:
# @return a list of lists of integers
def generate(self, numRows):
if numRows==0:
return[]
rst=[[1]]
i=1
for j in range(1,numRows):
row=[1]
for i in range(1,j):
row+=[rst[-1][i-1]+rst[-1][i]]
row+=[1]
rst.append(row)
return rst
Sunday, September 7, 2014
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment