Min Li's Note
KVM,QEMU, X86 virtualization
Pages
Home
Collection
About
Saturday, October 4, 2014
Pascal's Triangle
Problem
Given numRows, generate the first numRows of Pascal's triangle.
For example, given numRows = 5,
Return
Idea
从第3行开始,对于每一行,第一个是1,最后一个是1,其他的 a[i][j] = a[i-1][j-1]+a[i-1][j];
Solution
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment