[BaekJoon] 3052번: 나머지 (Python)
- Reference
- 디포트 딕셔너리 사용
Solution
import collections
def solution(nums):
remainders = collections.defaultdict(int)
for num in nums:
remainders[num % 42] += 1
return len(remainders)
nums = []
for _ in range(10):
nums.append(int(input()))
print(solution(nums))
Leave a comment