← Back to challenges

"InnoKod" Challenge

JavaScriptHardalgorithmsmath

Instructions

Create a function that returns the array of numbers from a given range. But for multiples of three, return "Inno" instead of the number and for the multiples of five, return "Kod". For numbers which are multiples of both three and five, return "InnoKod".

Examples

innoKod(0, 10) ➞ ["InnoKod", 1, 2, "Inno", 4, "Kod", "Inno", 7, 8, "Inno", "Kod" ]

innoKod(14, 20) ➞ [14,  "InnoKod", 16, 17,  "Inno", 19, "Kod" ]

innoKod(99, 106) ➞ ["Inno", "Kod", 101, "Inno", 103, 104, "InnoKod", 106 ]

Notes

In case the number 0 happens to be in the range, return "InnoKod" as well.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Burglary Series (02): Most Valuable Item