SWEA 1204 - 최빈수 구하기


SWEA 1204 - 최빈수 구하기

12345678import collections T = int(input())for test_case in range(1, T + 1): print("#",end="") print(int(input()),end=" ") data = list(map(int, input().split())) print('#{} {}'.format(test_case,collections.Counter(data).most_common()[0][0]))cs collections.Counter(data).most_common() : 데이터 list 내의 최빈수와 빈도수를 튜플형태로 내림차순 출력...

SWEA 1204 - 최빈수 구하기에 대한 요약내용입니다.

자세한 내용은 아래에 원문링크를 확인해주시기 바랍니다.



원문링크 : SWEA 1204 - 최빈수 구하기