2022-6: Pyramid Scheme

Write a monadic function that:

- takes an argument n that is an integer scalar in the range 0-100.

- returns a square matrix "pyramid" with 0⌈¯1+2×n rows and columns of n increasing concentric levels.

- By this we mean that the center element of the matrix will be n, surrounded on all sides by n-1.

Examples

Implementation

You can also run the tests via ⌘/shift + enter