In C++, solutions in O(n^2) work just fine. I think the warning in the description is rather missleading, since I, for my part, could not think of a solution in (lower case) o(n^2).
Thanks - fixed. Really, compiler warnings about code like a && b || c && d are excessively presumptuous - surely only novice programmers are likely to be unaware of the order of boolean operations?
Yes, negative values are intended. You were right about the low rate of occurence in the tests ; has been fixed, thanks.
It was omitted from the description on purpose. Please see comments from cyril and dinglemouse in the companion kata A Simple Music Decoder. We more or less agreed that omitting them from the description was OK (i.e. cyrils "final boss" test).
Cheers!
I wonder if arrays with negative values generated in randonTests() are intended, since they're very rare (only about 8%) and never mentioned in the description.
If they are, it should be mentioned in the description and the rate of occurence or the amount of random tests should be increased, since this low rate would regularly allow solutions, that disregard negative values (like mine did).
I appreciate your response and see your point. However, personally, I'd not take that as an argument to allow even further faulty submission, because that would make the concept of this whole game pointless, wouldn't it?
I like your solution :-)
In C++, solutions in O(n^2) work just fine. I think the warning in the description is rather missleading, since I, for my part, could not think of a solution in (lower case) o(n^2).
Mind that this solution causes UB for space-only (that is also empty) strings.
Particularly simple but clever regex, tho!
This will accept many illegal string like
][
.Very much agreed. I'd not want my compiler to warn me about those.
Thanks for the fix :)
Thanks - fixed. Really, compiler warnings about code like
a && b || c && d
are excessively presumptuous - surely only novice programmers are likely to be unaware of the order of boolean operations?Someone explain this magic pls :o
The Test cases cause compiler warning if compiled with Clang 8 C++17.
The fix should be trivial.
Hey Reizo,
Thank you for your help.
Cheers!
I wonder if arrays with negative values generated in
randonTests()
are intended, since they're very rare (only about 8%) and never mentioned in the description.If they are, it should be mentioned in the description and the rate of occurence or the amount of random tests should be increased, since this low rate would regularly allow solutions, that disregard negative values (like mine did).
Oh well, that disappoints me a little. Thanks though for your clarification.
Errr... That's not an argument but rather a fact! The test cases are LOCKED and so modifications are not possible anymore. ;)
I appreciate your response and see your point. However, personally, I'd not take that as an argument to allow even further faulty submission, because that would make the concept of this whole game pointless, wouldn't it?
Can you name an example, please?
Hi,
Unfortunately, there are already too much completions of the java version (more than 500) so the tests are not modifiable anymore.
Loading more items...