You are viewing a single comment's thread. Return to all comments →
I should have used counter, but works too with defaultdict (used as counter)
from collections import defaultdict room_dict = defaultdict(list) input() room_numbers = input().split() for room in room_numbers: room_dict[room].append("1") for room, tourists in room_dict.items(): if len(tourists) == 1: print(room)
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 →
I should have used counter, but works too with defaultdict (used as counter)