Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle.

n Pascal’s triangle, each number is the sum of the two numbers directly above it. Example: Input: 5 Output: [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] Solution analysis: In each row, the first and last element are 1. And the other element is the sum of the two elements in the previous row. e.g. 1 … Continue reading Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle.