Lonely Integer

  • + 0 comments
    from collections import Counter as c
    
    def lonelyinteger(a):
        b = c(a)
        r = [i for i,j in b.items() if j == 1]
        return print(*r)
    
    if __name__ == '__main__':
        n = int(input().strip())
        a = list(map(int, input().rstrip().split()))
        lonelyinteger(a)