Pascal's triangle starts with row 0 equal to [1]. Every next row begins and ends with 1, and each inner value is the sum of the two values above it:
row 0: 1
row 1: 1 1
row 2: 1 2 1
row 3: 1 3 3 1
row 4: 1 4 6 4 1
Return row number row as a list. The values get big, and Python integers handle that exactly.
Example 1
Input:
pascal_row(4)
Output:
[1, 4, 6, 4, 1]
Example 2
Input:
pascal_row(0)
Output:
[1]
0 <= row <= 1000No results yet
Run your code to check it against the examples, or submit to run every test.