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.
Added sample and random test for JS.
This comment is hidden because it contains spoiler information about the solution
i did it in the same way, but i passed all the test
Yes, so you can see with what values your code fails and fix your code.
Print the input.
I'll mark this as resolved. If you still need help, post a new question with more information.
Print
newArray
andnewNum
, so you'll realize where your code went wrong. You could also use something like Pythontutor to visualize it.Please read this: https://docs.codewars.com/training/troubleshooting/ and mark your post as having spoiler content next time. To debug your code, print the middle values. Right now, your code only works with single digit numbers.