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.
Thanks!
This comment is hidden because it contains spoiler information about the solution
Sorry for the slow response. Please see my answer to bonhart67 👍
explain please
can you explain the thought process behind this solution?
Nice! I'm no guru on regex and hadn't been able to identify what was going wrong. You've helped me learn something, so cheers for that : )
Yes, you're absolutely right! My code is wrong.
I remember being a bit annoyed by the opinionated tests, so I might have taken a shortcut there.
That's a sin of course, sorry for that ;-)
At a glance, the two things that might be the issue here are:
Thanks for your comment, much appreciated!
Seems as though something's not quite right here. For example, the code results in "07.1.1.1" being valid, but "08.1.1.1" is not.
"127.0.0.1" is not valid either, although that could be blamed on the poor quality of the description and test cases given for the exercise.
I'm not sure if understand the Kata correctly or if there is an error.
After running the test for submission, I had these failed tests:
Some random tests
✘ Line = 100,25,25,25,100,25,50,25,100,25,50,25,100 - Expected: YES, instead got: NO
✘ Line = 100,25,25,25,100,25,25,50,100 - Expected: YES, instead got: NO
✘ Line = 100,25,25,25,100,25,25,25,100,25,50,25,100,25,25,50,100 - Expected: YES, instead got: NO
✘ Line = 100,25,25,25,100,25,25,50,100,25,25,50,100 - Expected: YES, instead got: NO
✘ Line = 100,25,25,25,100,25,25,50,100 - Expected: YES, instead got: NO
✘ Line = 100,25,25,50,100,25,25,25,100,25,25,50,100 - Expected: YES, instead got: NO
If Vasya has no money to start and a ticket costs $25, how can he give change if the first person pays with $100?
The set of test cases for this kata need tightening up. I've found a number of published solutions that should not have been allowed to pass.
one C# solution, which has been marked up as being 'clever', even fails to pass the simple test [25, 50] => "YES".
Another published solution I found doesn't take into account the instruction to "sell the tickets strictly in the order people follow in the line" and fails the test [25, 25, 25, 100, 50, 50, 100, 25] => "NO".
Kata validation tests should properly reflect all given requirements.
This code fails for even the simplest test: [25, 50] => YES
The set of test cases needs fixing on this kata!