[구름 Level] 환경과 쥐 크기의 상관관계

 

문제

from collections import Counter

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

def find(ls):
    dic = Counter(ls)
    set_ls = set(ls)
    ans_cnt = 0
    ans = 0
    for i in range(3, max(set_ls)):
        ran = list(range(i-2, i+3))
        cnt = 0
        for j in ran:
            if j in dic.keys():
                cnt += dic[j]
        if cnt > ans_cnt:
            ans = i
            ans_cnt = cnt
    return ans

print(find(a), find(b))
if find(a) > find(b):
    print('good')
else:
    print('bad')