Skip to content

Instantly share code, notes, and snippets.

@maazrk
Last active January 27, 2022 04:06
Show Gist options
  • Save maazrk/41674acce1f59e30766f023d04fd61ca to your computer and use it in GitHub Desktop.
Save maazrk/41674acce1f59e30766f023d04fd61ca to your computer and use it in GitHub Desktop.
Find the non-repeating element
arr = [1, 2, 5, 4, 6, 8, 9, 2, 1, 4, 5, 8, 9]
v = 0
for i in range(len(arr)):
v = v ^ arr[i]
print(value)
#OUTPUT = 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment