Start a Thread

Subscribe You’re not receiving notifications from this thread.

Pyramid Puzzle (Main Thread)

Here is the interview question prompt, presented for reference.

In a certain kind of pyramid, each number in a row is the sum of the two numbers directly above it (arranged in a triangular fashion).


Given an integer n, return the first of the n rows of the pyramid.

For example, if n = 5, then the first 5 rows of the pyramid will be represented in the array form as follows,

[[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1]]


  • 1 <= n <= 30

You can see the full challenge with visuals at this link.

Challenges • Asked 8 months ago by Jake from AlgoDaily

Jake from AlgoDaily Commented on Oct 05, 2022:

This is the main discussion thread generated for Pyramid Puzzle (Main Thread).