Skip to content

Latest commit

 

History

History

lengthAndTwoValues

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Length and two values.

7 kyu link to kata
my solution

Given an integer n and two other values, build an array of size n filled with these two values alternating.

Examples

5, true, false     -->  [true, false, true, false, true]
10, "blue", "red"  -->  ["blue", "red", "blue", "red", "blue", "red", "blue", "red", "blue", "red"]
0, "one", "two"    -->  []

Good luck!