Skip to content

Instantly share code, notes, and snippets.

@brittanydionigi
Last active September 12, 2017 14:47
Show Gist options
  • Save brittanydionigi/9f94d1069682ceb6f7e02763a976d342 to your computer and use it in GitHub Desktop.
Save brittanydionigi/9f94d1069682ceb6f7e02763a976d342 to your computer and use it in GitHub Desktop.
pascal

Read about Pascal's Triangle here

Pascal

Write a function that, given a depth (n), returns an array representing Pascal's Triangle to the n-th level.

For example:

pascalsTriangle(4) #=> [1, 1, 1, 1, 2, 1, 1, 3, 3, 1];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment