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
|
1565 Discussions
|
Please Login in order to post a comment
Solution with only implement set concept
from collections import Counter k=int(input()) ABC = Counter(input().split()) for item,value in ABC.items(): if value==1: print(item)
member = int(input()) lst = list(map(int, input().split())) dct = dict()
for i in lst: if i in dct: dct[i] += 1 else: dct[i] = 1
for key, value in dct.items(): if value == 1: print(key) break;
Enter your code here. Read input from STDIN. Print output to STDOUT
k = int(input()) l = list(map(int,input().split())) l.sort()
for i in range(0,len(l)-1,k): if l[i] != l[i+4]: break
print(l[i])