Clever indeed!
However, debugging this solution would be a pain. For instance, if there is no odd number in the array, the result would be 0; the same result as if we had an odd 0 in the array. If there were multiple odd numbers, the result would be unpredictable as well.
The input should always be correct. Thus, the solution is great for a coding playground, but will definitely bite you if you use it in a real project.

The description says: "There will always be only one integer that appears an odd number of times."
In your input there are two such numbers 10 and 1. So you get 11. Therefore the solution is not buggy.

Python 3 should be enabled.

well explained - thank you!

It's good that you've understood the solution but remember

the spoiler flagThis comment is hidden because it contains spoiler information about the solution

omg you solved this in legit one line, great stuff

argument has a different name - you should change array.length to A.length

amazing!

Sick! Will definitely read more about the XOR operator.

Clever indeed!

However, debugging this solution would be a pain. For instance, if there is no odd number in the array, the result would be 0; the same result as if we had an odd 0 in the array. If there were multiple odd numbers, the result would be unpredictable as well.

The input should always be correct. Thus, the solution is great for a coding playground, but will definitely bite you if you use it in a real project.

Omg... this answer is so beautiful!

Thank you!!!

What is it?

您Sb?

you saved me!

The description says: "There will always be only one integer that appears an odd number of times."

In your input there are two such numbers 10 and 1. So you get 11. Therefore the solution is not buggy.

## Loading more items...