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.
This is definetely a fitting solution for the quality of the original kata.
This comment is hidden because it contains spoiler information about the solution
V inefficient for large lists though
This comment is hidden because it contains spoiler information about the 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
This comment is hidden because it contains spoiler information about the 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
We can criticize the solutions, but actually the problem is with the Kata: there are no test cases for the negative case. Yes, it's easy to slip through on this, but that's why the tests should cover all cases, not just the happy ones.
This should be upvoted as best practice. Yes, not a one-liner, but the array length is not hardcoded, either.
Obviously a bad solution (I'm only estimating.)
If it wasn't almost midnight, I would come up with a test-case to prove this wrong.
This comment is hidden because it contains spoiler information about the solution
I know, my solution is wrong, I'm working on an improvement.
Clever. I was thinking for a couple of minutes why my solution works without checking for the leading zeros rule, and wanted to come up with a countering test case. As I couldn't, I reasoned that actually it's not possible to give such an example (wrongly believing that my solution is actually good). The result is that I feel bad 'cheating' with my solution, and also I made myself stupid by wrongly explaining why my solution is good. Double fail :-)
Just a comment on the last couple: actually those are the reasons I failed.
It's true,
507 -> 057 -> 075 (2)
but also
507 -> 570 -> 750 (2)
So really the only counterexample is when you have to move 2 zeros to the end, instead of just moving one number from the front to the back.
Loading more items...