Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import os
- import random
- import re
- import sys
- #
- # Complete the 'lonelyinteger' function below.
- #
- # The function is expected to return an INTEGER.
- # The function accepts INTEGER_ARRAY a as parameter.
- #
- def lonelyinteger(a):
- # Write your code here
- val=0
- for i in a:
- val=val^i
- return val
- if __name__ == '__main__':
- fptr = open(os.environ['OUTPUT_PATH'], 'w')
- n = int(input().strip())
- a = list(map(int, input().rstrip().split()))
- result = lonelyinteger(a)
- fptr.write(str(result) + '\n')
- fptr.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement