Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3d091b0

Browse files
Solution Accepted
1 parent 5170efd commit 3d091b0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎HackerRank-Migratory-Birds/solution.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/python3
2+
3+
import math
4+
import os
5+
import random
6+
import re
7+
import sys
8+
from collections import Counter
9+
10+
def migratoryBirds(arr):
11+
count = Counter(arr).most_common(5)
12+
return count[0][0]
13+
14+
15+
if __name__ == '__main__':
16+
fptr = open(os.environ['OUTPUT_PATH'], 'w')
17+
18+
arr_count = int(input().strip())
19+
20+
arr = list(map(int, input().rstrip().split()))
21+
22+
result = migratoryBirds(arr)
23+
24+
fptr.write(str(result) + '\n')
25+
26+
fptr.close()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /