Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 384 Bytes

PascalsTriangle.md

File metadata and controls

18 lines (13 loc) · 384 Bytes

Pascal's Triangle

Given a non-negative integer n, print the first n rows of pascal's triangle.

Pascal's triangle is a triangle in which each cell is the sum of the 2 cells above it.

example

Example

generate(4)
// should print:
// [ [1],
//   [1,1],
//   [1,2,1],
//   [1,3,3,1] ]