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.
Thanks. I think I would have understood that if the question had written out the rest of the numbers instead of "etc..."😅
Someone please help me understand this question. In the example it says the frequency is nine 1's, but then proceeds to show only six 1's in the test case solution. What the heck is this question asking me to do? Could someone please explain this... I'm wasting my time just trying to understand why the example is the correct solution.
"The digit frequencies are 1 x 0, 9 x 1, 6 x 2 etc...
and so the method would return [1,9,6,3,0,1,1,1,1,1]"
This output only has six 1's, and no 2's instead of 9 and 6 respectively...what are we returning??
This comment is hidden because it contains spoiler information about the solution
woops, replied to wrong comment, how to delete?
Hi @neilm. If I pass in the array: sumOfDifferences([3,4,5,6,3]) it appears my solution gives a different answer than this solution code does. Which is returning the correct answer here and how, since both passed the testcases? Mine returns 3, his code returns 6 for the above sample
This comment is hidden because it contains spoiler information about the solution
Why did this kata mention 1.77 like it was important information to be used in the solution? At least I assumed it would be used. Of course, it didn't work when I tried math.round with 1.77 * y. The only answer I found online multiplied y by 1.77777 to get the answer, which is a hacky way of doing it. As a new coder, this one was a bad experience, the question is misleading. At 8kyu, we're still just trying to successfully apply the methods we're learning. Why stack deciphering a misleading question on top of that?
How come you don't need to write return anywhere for this to work?
With my solution without return statements it doesnt seem to work.