Challenge 2: Pascal's Triangle
Explore how to implement a recursive function that returns the nth row of Pascal's Triangle. Understand the binomial coefficient relationship and practice applying recursion to numerical problem-solving challenges. This lesson helps strengthen your recursion skills for coding interviews by solving a real problem involving mathematical patterns.
We'll cover the following...
Problem Statement
Implement a function that takes a number testVariable and returns the row of the Pascal’s triangle corresponding with that number.
What is Pascal’s Triangle?
Pascal’s Triangle is a triangular array of the binomial coefficients.
To build Pascal’s Triangle we start with 1 at the top, then continue placing numbers below it in a triangular pattern. Each number is the sum of the
two numbers directly above it.
The entry in the row and column of Pascal’s triangle is denoted as:
...