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.
The one-liner is using built-in methods to do the conversion (
[0, 0, 0, 1]
->["0", "0", "0", "1"]
-->"0001"
-->1
)Whilst yours is doing the mathematical approach.
The code for string replacement is wrong because you intended to replace all substrings with positioning beyond
counter
whilst the correct way is to replace the specified character with respective position.This comment is hidden because it contains spoiler information about the solution
🤣
I read somewhere that the return command exits the whole function. This means that the loop wouldn't be repeated since it is no longer running the function where the loop is in.
Edit: fixed some grammar and punctuation errors
lmao what is a 25 dollar bill
This comment is hidden because it contains spoiler information about the solution
I got it! Thank you. I had the else block on the wrong indent, I should have inlcuded it with the "x == 100" part. Thanks again!
Look closely what happens when they pay you with a 100 dollars bill. Read this too: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution