Skip to content

Instantly share code, notes, and snippets.

@amulyakashyap09
Created January 1, 2018 14:04
Show Gist options
  • Save amulyakashyap09/c624e7b5637b762f5cadb5c1ee7d6291 to your computer and use it in GitHub Desktop.
Save amulyakashyap09/c624e7b5637b762f5cadb5c1ee7d6291 to your computer and use it in GitHub Desktop.
The captain's room | Hackerrank
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