We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Sets
- The Captain's Room
- Discussions
The Captain's Room
The Captain's Room
Sort by
recency
|
1503 Discussions
|
Please Login in order to post a comment
hello there
K = int(input()) rooms = list(map(int,input().split()))
Group = {} for i in rooms: Group[i] = Group.get(i,0) +1
for key, value in Group.items(): if value == 1: print(key)
a = int(input())
set_a = list(map(int, input().split()))
seen_once = set()
seen_multiple = set()
for i in set_a: if i in seen_once: seen_multiple.add(i) else: seen_once.add(i) unique_elements = seen_once - seen_multiple for element in unique_elements: print(element)
from collections import Counter
k = int(input())
room_no = list(map(int,input().split()))
room_count = Counter(room_no)
for keys, values in room_count.items():
if values < 5: print(keys)