Hackerrank – Pascal’s Triangle

Problem Statement
A description of the problem can be found on Hackerrank.

Solution
I created recursive function for factorial

    \[fact\]

.
Then create all combinations of rows and column indexes. For input 4 it looks like:

Apply function for pascal triangle

    \[\frac{fact(row)}{fact(column) \times fact(row - column)}\]

for each combination.

I created solution in Scala:
The solution is also available on my GitHub.

Scala