triangle

[Leetcode] Pascal's Triangle II 杨辉三角

Pascal's Triangle II Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. 从后往前覆盖法 复杂度 O(N) 时间 O(K) 空间 思路 一行一行地迭代,后面一行迭代覆盖前一行,窍门是:从后往前算