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.
looks like you've solved it ~~
This comment is hidden because it contains spoiler information about the solution
You can do whatever you want as long as it's valid code. Whether such approach is viable you can find out yourself.
Because those were the test cases, it isn't a functional solution as it only works for the tests that were developed for this kata and nothing else.
Print the input inside function.
You've already answered your question. There's a trivial mathematical trick which you can (should) use to calculate the number of zeroes. If your code is
O(n)
, it is already fundamentally wrong, and you should search for another solution.This comment is hidden because it contains spoiler information about the solution
You're not handling the case when only the first argument is given.
Use spoiler flag next time, please.
n you return just a number. In doubt, look at the sample tests.
Note: don't forget to give the language when posting, that avoids others to have to go to your profile page
Empty string should return empty string, you can see that in the error message and in the test.
the answer to your question is right there in the error message
Yes, that's what the description says.
you've got two problems with the logic of your loop ~ all I can say is you need to walk through every single step the code takes and carefully think outloud the exact outcome of each step as you do. also, creating a flow chart is another useful way to see what the code actually does
.
Loading more items...