EricssonOA #1
Pascal's Triangle
简单可在线判题
考点(AI 标注)动规入门
Given a non-negative integer numRows, return the first numRows rows of Pascal's triangle.
输入格式
A single integer numRows (0≤numRows≤30).
输出格式
Output a compact JSON 2D integer array; output [] when numRows=0.
样例 1
输入:
0
输出:
[]
样例 2
输入:
5
输出:
[[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]
样例说明
Build each new row from the sums of adjacent elements in the previous row.