Welcome to the Pascal's Triangle assignment. We hope you'll have fun!
Pascal's Triangle is an infinite list of growing lists of numbers.
An example of the first 5 rows of Pascal's Triangle is as follows:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Each row is constructed as follows:
- In row 0, the triangle starts with a single-element list with value 1.
- Each subsequent row is constructed by adding the value above to the left with the value exactly above.
- A value outside the previous row is counted as 0.
The triangleRow function is not implemented yet.
The objectives for this assignment is:
- Implement the
triangleRowfunction so it returns the correct row of Pascal's Triangle for a given indexn. - Make sure the tests pass.
You can run all the tests by entering the following in your terminal:
$ ./gradlew testor
$ gradlew.bat testor
$ mvn testAll the best and happy coding,
The Xebia Team.