THE CHALLENGEPASCAL_TRIANGLE — Pascal's triangle.
Read the size n of a Pascal triangle. The first and last element of each row are 1; the other elements satisfy T[l, c] = T[l-1, c] + T[l-1, c-1]. Print Pascal's triangle of size n, one row per level, the numbers separated by a space.
Input:
5
Output:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Pascal challenge: each row is built from the previous one - no factorial, no math.comb, no import.
Checks (verified automatically before your code runs):
- Loops may be nested at most 2 levels deep.
- Do not use comb().
- Do not use factorial().
- Not allowed: imports.
Hint: next row = [1] + [sums of two neighbours] + [1].