DSA_Worksheet
DSA_Worksheet copied to clipboard
Print Pascal's Triangle
❗Write Code in Only One Language (CPP, C, Java, Python)
Give File Name : pascal_triangle ✅ In respective language folder
📑 DESCRIPTION
Pascal's Triangle
Problem Statement: You are given an integer ‘N’. You need to return the first ‘N’ rows of Pascal’s triangle.
Example
Input:
N = 4
Output:
1
1 1
1 2 1
1 3 3 1
Explanation: The output matrix has the first four rows of Pascal’s Triangle.
Input Format:
The first line of the input will contain an integer ‘N’.
Output Format:
Print the first ‘N’ rows of Pascal’s Triangle.
Sample Input 1
5
Sample Output 1
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Explanation of Sample Input 1
Input:
N = 5
Output:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Explanation: The output matrix has the first five rows of Pascal’s Triangle.
Sample Input 2
3
Sample Output 2
1
1 1
1 2 1
Constraints
1 <= N <= 30
Time Limit: 1 sec
assign me
assign me
hey @Chitresh-code i hope ur doing well ,can uu assign me this work
@awsmdeep @Anjali0109 @Chetan-KH511 assigned it to you
please assign this issue to me
@Chitresh-code Hey there, I would like to contribute to this repository so could you please assign this issue to me.
I would like to work on this, pls assign to me
@Chitresh-code Can you please assign this to me?