You are viewing a single comment's thread. Return to all comments →
Using sets specifcally:
K = int(input()) s, ignore = set(), [] for room in map(int, input().split()): if room in s: s.remove(room) ignore.append(room) else: if room not in ignore: s.add(room) print(s.pop())
Seems like cookies are disabled on this browser, please enable them to open this website
The Captain's Room
You are viewing a single comment's thread. Return to all comments →
Using sets specifcally: