Pascal Triangle ​
Given an integer numRows, generate the first numRows rows of Pascal's triangle.
Approach ​
The most optimized solution is an $n^2$ solution. Initialize the first row in list. From second row: The first element would always be $1$. The next element would be last row's i-1 value + last row's i value. Last value will also be $1$.