LeetCode p119 Pascal’s Triangle II 题解
1.题目:
Given an index k, return the kth row of the Pascal’s triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only O(k) extra space?
题意:
输入一个数K 求杨辉三角形第K列【从0开始
2.解题思路:
见代码
3.代码
1 |
|