Given an integer n, return the first n rows of Pascal's triangle.
In Pascal's triangle:
1.For example, given n = 5, the triangle looks like:
[1]
[1,1]
[1,2,1]
[1,3,3,1]
[1,4,6,4,1]
n = 5[[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]n = 1[[1]]n = 3[[1],[1,1],[1,2,1]]1 <= n <= 30Run your code to see results
Use Cmd+Enter to run