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 adbe102

Browse files
authored
Solution
1 parent ec83671 commit adbe102

File tree

1 file changed

+27
-0
lines changed

1 file changed

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

0 commit comments

Comments
(0)

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