ผิด ๆ ต้องอันนี้
res = [[1]]
for i in range (1, numRows):
begin = [1]
end = [1]
last = res[-1]
middle = [last[j-1] + last[j] for j in range(1, len(last))]
row = [1] + middle + [1]
res.append(row)
return res
Last posted
Total of 3 posts
ผิด ๆ ต้องอันนี้
res = [[1]]
for i in range (1, numRows):
begin = [1]
end = [1]
last = res[-1]
middle = [last[j-1] + last[j] for j in range(1, len(last))]
row = [1] + middle + [1]
res.append(row)
return res
Be Civil — "Be curious, not judgemental"
All contents are responsibility of its posters.