DEV Community

Discussion on: The Good, The Bad and The Ugly Solutions to Leetcode’s Single Element in a Sorted Array

Collapse
 
fumblehool profile image
Damanpreet Singh

Nice!
Another way would be bit-wise manipulation.
Perform XOR operation for every element. The result of XOR operations will be our required result.

Collapse
 
codechunker profile image
codechunker

wow i would love to know how to do that. Not so good with bit manipulations. Please can you help. would love to learn from you thank you.