mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Toussaint Louis
51fd4a0ae3
|
3 years ago | |
---|---|---|
.. | ||
README.md | 3 years ago |
README.md
FikBuk
Instructions
Create a fikBuk
function that takes a number n
and will start counting from
1
to n
.
You will return an array from those values
for each numbers in between 1
and n
you must do the following:
- if the number is a multiple of
3
addFik
to the array - if the number is a multiple of
5
addBuk
to the array - if the number is a multiple of both
3
and5
addFikBuk
to the array - otherwise add the number to the array
Example:
fikBuk(3) // -> [1, 2, 'Fik']
fikBuk(5) // -> [1, 2, 'Fik', 4, 'Buk']
fikBuk(16) // -> [...7, 8, 'Fik', 'Buk', 11, 'Fik', 13, 14, 'FikBuk', 16]