Pascal's Triangle
M · mediumPracticematrixpattern-printing
Problem
Print Pascal’s Triangle for N rows.
Example
Input
4
Output
1 1 1 1 2 1 1 3 3 1
Each row i: C(i,j) = C(i-1,j-1) + C(i-1,j). Print with leading spaces for formatting.
Print Pascal’s Triangle for N rows.
4
1 1 1 1 2 1 1 3 3 1
Local Storage Only
Your progress is saved securely in your browser. No account needed. (If you clear data or switch devices, progress resets).