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.
Can it do " A,"?
counter is useless, a simple input of (1011, 11) breaks your solution
Does this solution produce side effects?
I know the input string is rather short, but I think it can be easily done with less iteration with the use of dict or Counter. This would probably reduce algorithm complexity.
I've also used Counter in my solution, but in slightly different way. I iterate over the first counter's items instead of the possible digits.
Yes, it could, but I think deciding that for yourself is part of the kata.
Yes, I understand. It could be probably written explicitly in the kata description, which strategy you should choose to pass tests.
You need to choose the strategy, if you can give back the change with one, then you can.
This comment is hidden because it contains spoiler information about the solution
Thanks for that remark!
As you can see I am not a master of regex :D
Funny solution! My monitor is too narrow to read this :D Will it work for 12-31? Who knows what else might be missing? :D
I'd use other name, e.g. 'outlier', where You used name 'odd', for clarity, to differentiate outlier-odd number from normal odd numbers.
I don't know if it is the best practice, but I did it in a similar fashion. It seems pretty straightforward.
Any two words are similar to each other in kata's definition by removing all characters of the first and adding all characters of the second in right order.
And you need an algorithm more than those library :)
You can use any operations from [adding, removing and replacing] operator that getting the desired word in minimum steps.
So answers for your questions are 1 (for adding) and 1 (for removing) respectively.
Loading more items...