Shermans's Notes
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Lonely Integer - XOR Integer Pairs

Lonely Integer - XOR Integer Pairs From Hacker Rank, Lonely Integer Challange Taking an array of integers, where it a guarenteed that the size is odd, and all enteries bar one is a pair, return the integer that only appears once. I knew there must be a trick to this however I didn’t figure it out. I implemented a basic solution using a map to count instances which was obviously O(N) in time.
Read full post gdoc_arrow_right_alt