Mubashir was reading about Pascal's triangle on Wikipedia.
In mathematics, Pascal's triangle is a triangular array of the binomial coefficients that arises in probability theory, combinatorics, and algebra.

Formula for Pascal's triangle is given by:

where n denotes a row of the triangle, and k is the position of a term in the row.
Create a function which takes a number n and returns n top rows of Pascal's Triangle flattened into a one-dimensional list.
pascals_triangle(1) ➞ [1]
pascals_triangle(2) ➞ [1, 1, 1]
pascals_triangle(4) ➞ [1, 1, 1, 1, 2, 1, 1, 3, 3, 1]
N/A