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.
Added to all languages
I have added some more random test cases. Solutions that ignore the order will not pass anymore. Some of the more "clever" solutions are also invalid. However, it seems like updating the test cases will not invalidate those solutions. (Or maybe it just takes some time.)
If you would like to try again and see if the test cases feel better now, I would be very thankful.
Thanks again for pinging me on this. :-)
Closing issue.
Closing issue.
It has been impossible for me to add more test cases after the kata was published, but it seems to have changed. I'll get on it shortly.
Thanks for making me check again! :-)
Can we add some more test cases for Java to stop some of the solutions that have gone through as correct but don't meet the description?
Some examples:
assertTrue(StringMerger.isMerge("abac", "ab", "ac"));
assertTrue(StringMerger.isMerge("abac", "ac", "ab"));
assertFalse(StringMerger.isMerge("abcad", "acd", "ab"));
assertFalse(StringMerger.isMerge("abcad", "ab", "acd"));
assertFalse(StringMerger.isMerge("abc", "ac", "a"));
Can we add a test case to stop this incorrectly being marked as correct?
Your suggested unit test does return 0 when I run it against my solution. What is the issue here?
Hi
I'm a bit confused by your issue. Are you saying that you wrote a solution that passed all the test cases but it also returned
0
for 11123455567890 and 12345567890?This is the issue I'm having:
square_digits': undefined method
digits' for 3212:Fixnum (NoMethodError)from `
'
The code I have runs fine on my computer, but not with this. I'm wondering if there's an issue with the version number as Integer#Digits came with the lastest verion of ruby.
You should assume that the compiler will execute your commands as you give them. Even if you wanted the compiler to handle that, it has no way to recognise that the first multiplication on the second line is the inverse of the function call on the first, especially when you've got a cast in between the two statements.
The extra work done on the second line also makes it hard to read.
This needs a unit test that has a 0 in it, my code choked on that the first time because I got a number with a 0 in the random test.
This needs a unit test to ensure that the code doesn't give a false positive when the double in the second number isn't of the same digit as the triple in the first number. For example, 1112345 122345 should return 0.
When I first tried this I came up with a solution that would return 0 for the numbers 11123455567890 and 12345567890, but succeeded for the tests given. Could this be added as a unit test?