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.
The ^= operator performs a bitwise OR (^) and assigns the result to the variable (xor)
https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html
What is being done here, is simply taking the XOR of all the numbers (one at a time) to check the last bit.
XOR means that if both bits are 1, the result is 0, and only if only of the two numbers is 1, the result is 1
Since odd or even is completely determined by the last (least significant) bit being 1 (odd) or 0 (even), this is all you need to know.
Hence the final &1 to see if that bit is 1 or not.
you can log an issue on the dashboard if you think the test cases allow incorrect solutions to pass
I don't think this will always be correct since the second part of the check uses the speed.
The first part checks the snail makes actual progress, but it can still be the snail makes progress, just not enough to reach the end in 1 year.
That is: length/speed may be less then 1 year meaning it would have reached the initial end.
But that does not mean it can also cross the extra length fast enough.