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.
Performance is not only about short code or long code. You need to think about the time and space complexity. I'm having the same issue while it's an 0(n). I'm trying to find the best way to do this
Groovy Translation
Rust version lacks random tests
Your solution has a bug and it will not work in pycharm if you run it more than once.
Bugs in your solution are not a kata issue.
This comment is hidden because it contains spoiler information about the solution
great!
It would be nice to show the input when the test fails.
If you use lodash, it can be
_.sample(charset)
and no problems with indexing :)EDIT: fixed
There is nothing stated about whether or not the input should only be English letters + spaces + ..., so any character can be used in test cases. And using
.indexOf(x)
with padding instead of.indexOf(x) + 1
in this case is incorrect, so that should be tested as well.It's fixed for the underscore character, but the general issue still stays that a filler character can be used and won't be detected, because detecting it would require testing of the whole character space. I would say that using a character outside of the alphabet used by the problem as padding is not incorrect. What do you think?
fixed (see JS fork above)
Done
Merged
JS fork
OP solved it, closing
Loading more items...