Given an indexk, return thekthrow of the Pascal's triangle.
For example, givenk= 3,
Return[1,3,3,1].
Note:
Could you optimize your algorithm to use onlyO(k) extra space?
从后往前算更简单,两种方法, 原理一样。
Given an indexk, return thekthrow of the Pascal's triangle.
For example, givenk= 3,
Return[1,3,3,1].
Note:
Could you optimize your algorithm to use onlyO(k) extra space?
从后往前算更简单,两种方法, 原理一样。