Created
January 1, 2018 14:04
-
-
Save amulyakashyap09/c624e7b5637b762f5cadb5c1ee7d6291 to your computer and use it in GitHub Desktop.
The captain's room | Hackerrank
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import groupby | |
K = int(input()) | |
lis = list(map(int, input().split())) | |
dic = {} | |
min=0 | |
for i in lis: | |
if str(i) not in dic: | |
dic[str(i)] = 1; | |
else: | |
dic[str(i)]+=1 | |
min = dic[list(dic.keys())[0]] | |
for i in dic: | |
if dic[i] < min: | |
min = dic[i] | |
mykey = i | |
print(mykey) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment