Pascal’s triangle/ pyramid

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

In Pascal’s triangle, each number is the sum of the two numbers directly above it.

Pascal’s triangle

Complexities : Time = O(n^2) and Space = O(n^2)

Leave a Reply

Your email address will not be published. Required fields are marked *