The Captain's Room

  • + 0 comments

    not sure what is trrying to be taught about sets here... with counter or dict/hashmap it's simple:

    lines = sys.stdin.read().splitlines()
    
    k = lines[0]
    rm_number_counts = {}
    for i in lines[1].split(' '):
        if i not in rm_number_counts:
            rm_number_counts[i] = 1
        else:
            rm_number_counts[i] += 1
    
    for k, v in rm_number_counts.items():
        # print(k , v)
        if v == 1:
            print(k)