Problem title
Difficulty
Avg time to solve

LCA of three Nodes
Easy
20 mins
Sum Of Infinite Array
Moderate
35 mins
Pair Sum
Easy
15 mins
Sum or Product
Easy
15 mins
Reverse The Array
Easy
15 mins
Flower Shop
Easy
--
Find Duplicate in Array
Easy
15 mins
Sort 0 1 2
Easy
22 mins
Two Sum
Easy
10 mins
Beautiful String
Easy
18 mins

Pascals Triangle

Difficulty: MEDIUM

Problem Statement

Given an integer N, you need to print the Pascal's triangle.

Note : The values of pascal's triangle can be large, so take mod with 10^9 + 7.

For eg. N = 4

   1
  1 1
 1 2 1
1 3 3 1

You can read more about Pascal's triangle here

Input Format :
Integer N
Output Format :
Pascals triangle in N lines
Constraints :

1 <= N <= 500

Sample Input :
6
Sample Output :
    1
   1 1
  1 2 1
 1 3 3 1
1 4 6 4 1
Reset Code
Full screen
copy-code
Console