Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
OP solved it, closing
Not a kata issue. Also, your code should return the array of original unmodified string instead of the change-cased one in which you use for comparison with values in dictionary.
Your code fails for cases like
n = 225
because it is divisible by9
, resulting in25
. However, there is no decimal point in25
, sop
now becomes [25
] (an array of string) due to splitting. Trying to access a non-existent index (1
) results inundefined
, and trying to accessundefined[0]
results in the Error.This comment is hidden because it contains spoiler information about the solution
The user's already solved the kata.
Not an issue.
Not an issue.
You'd have a whole other problem if your list is empty other than reduce here using strictly list.length as the denominator.
This comment is hidden because it contains spoiler information about the solution
Thanks I forgot about fractions
There are also non-integers.
This comment is hidden because it contains spoiler information about the solution
I am trying to understand you answer but I don't see how it is working.
Can you explain it please?
I always look at other answers after I solve a challenge to see how people solve the code with less lines, i've learned a lot looking at other people's answers. But I don't understand yours
Object.values
doesn't exist in CW's Node 6 version (it's a ES7 thing).Loading more items...