migratory birds1 [HackerRank] 07. Migratory Birds def main(): n = int(input()) arr = list(map(int, input().split())) result = solution(arr) print(result) def solution(arr): bird_type = [0] * 5 for value in arr: bird_type[value - 1] += 1 return bird_type.index(max(bird_type)) + 1 if __name__ == '__main__': main() 2020. 3. 9. 이전 1 다음