6 kyu

Pyramid Array

1,018 of 19,306sahglie

Description:

Write a function that given an integer n >= 0, returns an array of n ascending length subarrays, all filled with 1s.

0 => [ ]
1 => [ [1] ]
2 => [ [1], [1, 1] ]
3 => [ [1], [1, 1], [1, 1, 1] ]
Algorithms

More By Author:

Check out these other kata created by sahglie

Stats:

CreatedApr 5, 2013
PublishedJun 13, 2013
Warriors Trained28368
Total Skips2141
Total Code Submissions40971
Total Times Completed19306
Ruby Completions1018
Python Completions4885
JavaScript Completions4734
C# Completions767
Haskell Completions212
Swift Completions889
Go Completions905
Factor Completions25
Groovy Completions110
Scala Completions211
Clojure Completions132
CoffeeScript Completions19
Crystal Completions22
Dart Completions1102
Elixir Completions194
Elm Completions104
Julia Completions81
Lua Completions385
PHP Completions753
Racket Completions92
Reason Completions17
TypeScript Completions1344
C++ Completions1340
Rust Completions465
C Completions188
Java Completions199
Total Stars284
% of votes with a positive feedback rating92% of 1913
Total "Very Satisfied" Votes1637
Total "Somewhat Satisfied" Votes253
Total "Not Satisfied" Votes23
Ad
Contributors
  • sahglie Avatar
  • suic Avatar
  • anter69 Avatar
  • imjasonmiller Avatar
  • docgunthrop Avatar
  • JohanWiltink Avatar
  • wneumann Avatar
  • FArekkusu Avatar
  • _mer_ Avatar
  • hobovsky Avatar
  • trashy_incel Avatar
  • user8436785 Avatar
  • Kacarott Avatar
  • 4500zenja1 Avatar
  • KayleighWasTaken Avatar
Ad