Created
November 12, 2019 20:15
-
-
Save venelrene/6510d18873e626185a974f4df4597ee3 to your computer and use it in GitHub Desktop.
Write a function that when given a number >= 0, returns an Array of ascending length subarrays.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def pyramid(numbers) | |
| (1..numbers).collect { |n| [1]*n } | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment