Last active
May 21, 2023 23:41
-
-
Save thmain/748e1f5091f86da0c1bcf089da9272c7 to your computer and use it in GitHub Desktop.
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
def get_extra_element(arrA, arrB): | |
extra_element = 0 | |
for num in arrA: | |
extra_element ^= num | |
for num in arrB: | |
extra_element ^= num | |
print("Array A:", arrA) | |
print("Array B:", arrB) | |
print("Extra Element:", extra_element) | |
if __name__ == "__main__": | |
arrA = [3, 4, 5, 2, 9, 6] | |
arrB = [4, 3, 2, 9, 5, 7, 6] | |
get_extra_element(arrA, arrB) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment