The Captain's Room

  • + 0 comments

    using two sets

    a = int(input()) datas = list(map(int,input().split())) seta = set() setb = set() for each in datas: if each not in seta: seta.add(each) setb.add(each) else: #print(each) setb.discard(each)

    print(setb.pop())