Pascal's Triangle II

描述

Given an index k, return the k-th 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?

分析

滚动数组。

代码

相关题目

results matching ""

    No results matching ""