[HackerRank][Python3] Equalize the Array
2018. 9. 6. 01:18 |
프로그래밍/HackerRank
Problem :
https://www.hackerrank.com/challenges/equality-in-a-array/problem
My Solution :
#!/usr/bin/env python3 def equalize_array(arr): counter = [0 for _ in range(101)] for a in arr: counter[a] += 1 return len(arr)-max(counter) n = int(input()) arr = list(map(int, input().rstrip().split())) result = equalize_array(arr) print(result)
'프로그래밍 > HackerRank' 카테고리의 다른 글
[HackerRank][Python3] Lisa's Workbook (0) | 2018.09.06 |
---|---|
[HackerRank][Python3] Halloween Sale (0) | 2018.09.06 |
[HackerRank][Python3] Minimum Distances (0) | 2018.09.06 |
[HackerRank][Python3] Beautiful Triplets (0) | 2018.09.06 |
[HackerRank][Python3] Jumping on the Clouds (0) | 2018.09.06 |
[HackerRank][Python3] Sequence Equation (0) | 2018.09.05 |
[HackerRank][Python3] String Construction (0) | 2018.09.05 |
[HackerRank][Python3] Beautiful Binary String (0) | 2018.09.05 |
최근에 달린 댓글 최근에 달린 댓글