Pascal’s Triangle

pascal triangle

Problem Statement

The logic is in the above gif itself. We have to do the following things.
1. Hardcode 1 at 0th and last position of every row.
2. If we are at the ith row and jth column. We can get the value of pascal[i][j].

pascal[i][j] = pascal[i-1][j-1] + pascal[i-1][j];

Related Post

Leave a Reply

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