Tracks
/
Ruby
Ruby
/
Exercises
/
Pascals Triangle
Pascals Triangle

Pascals Triangle

Medium

Instructions

Compute Pascal's triangle up to a given number of rows.

In Pascal's Triangle each number is computed by adding the numbers to the right and left of the current position in the previous row.

    1
   1 1
  1 2 1
 1 3 3 1
1 4 6 4 1
# ... etc
Last updated 17 September 2021
Edit via GitHub The link opens in a new window or tab
Ruby Exercism

Ready to start Pascals Triangle?

Sign up to Exercism to learn and master Ruby with 16 concepts, 109 exercises, and real human mentoring, all for free.