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.
Finally a consolation.
This is exactly the type of code I would like to see in my team's code repository. This code is O(n) time and O(1) space. Could you show me any other, more readable solution, with similar characteristics?
What I would eventually add would be some comments explaining the algorithm, to account for newbies not really familiar with how binary operator work. But the alrgorithm itself is spot on for the stated problem. It does not waste time, it does not waste space, and XOR operation is one of the most basic ones, on par with arithmetic addition and logical OR.
If you were to propose a more readable solution, would it be something using the same algorithm as this one? Or some other algorithm with similarly good performance characteristics? Or some totally inferior (performance wise) algorithm which would eat up significantly more memory and/or time?
That's right. People are fucking idiots. Code should be short AND understandable, not just short.
had to find the explanation of the code
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I think I agree with u, I tried this solution and I couldnt even make it work, how I am susposed to know what this is about