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.
But that's not what the reference solution tests.
if (abs($gamma) <= 1e-5)
tests if acceleration is significantly different from zero, but allows negative acceleration above a certain threshold.
This implies that a negative acceleration is ALSO set to 0.
But the reference solution checks:
if (abs($gamma) <= 1e-5)
Which is a significantly different thing.
Whoever called words with subsequent characters on the same key 'good' obviously never typed on one of these.
Typing a second character on the same key as the last meant you had to wait for the first character to time-out before you could continue typing...
It's worth noting that this part of the description:
is not (or no longer) correct. As long as both methods follow signature compatibility rules, a class can implement two interfaces describing methods with the same name.
So the two interfaces in the exercise that overlap are actually compatible, as the methods are identical.
Issue with the PHP tests:
These incorrectly replace multiple consecutive input or output characters (
,
&.
) with just a singleputchar
/getchar
call.This is incorrect, as while reading multiple bytes from input would only store the last, it would still consume multiple bytes.
Same goes for the output: the written character would be the same each time, but it would still be written twice.
(The interpreter in the tests would print
Helo, World!
, with just a single 'l', for example).I could get my solution to pass by implementing the same error, but that is obviously not right.
Edit: Just noticed hotdonkey already reported this 9 months ago...
In the PHP version, the random tests will occasionally pop up an empty string instead of a number, combined with an error:
Stacktrace that is supplied with the code goes to the tests, not to the kata-code:
My code handles empty strings as zero, but the tests still fail, as an exception is thrown.
The tests for the PHP version use single quotes (') to enclose the 99-bottles string, but do use '\n' in an attempt to render newlines.
However, \n is only parsed in double-quoted strings, so the song is returned as one big string containing literal \n throughout.
This obviously causes valid solutions to fail, and forces you to mimic the incorrect syntax.
It looks like the tests for this Kata have expected and actual results reversed.
So if the function returns X when it should be Y, the test says 'expected collection contained X' and 'actual collection contained Y'
This comment is hidden because it contains spoiler information about the solution
The instructions don't specify if
total_count
andtotal_amount
should be all payments, or all payments made to either Jon or MikeAs the test database currently only has those two entries in
staff
, the results are the same, and both versions will pass the tests. But the corresponding queries are different, so it seems like an oversight.Wow. I just checked wikipedia, and you're absolutely right, it's under the 'additional constraints' section.
Every newspaper sudoku I've ever solved had that rule... Amazing.
Am I the only one who spent lots of time debugging their solution, only to finally notice that the requirements omit the standard Sudoku requirement concerning the diagonals also being complete sets?