Last active
May 4, 2023 15:11
-
-
Save iafsilva/2c7254230d070247a9cc413754481893 to your computer and use it in GitHub Desktop.
OddOccurrencesInArray-UltimateSolution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun solution(A: IntArray): Int { | |
var unpairedElement = 0 | |
for (element in A) unpairedElement = unpairedElement xor element | |
return unpairedElement | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment