[2022 KAKAO BLIND RECRUITMENT] 신고 결과 받기

Haram B·2022년 9월 21일
0

PS

목록 보기
2/6
post-thumbnail
def solution(id_list, report, k):
    answer = []
    report_dict = {}
    for id in id_list:
        report_dict[id] = []
        answer.append(0)
    for r in report:
        report_person = r.split(" ")[0]
        reported_person = r.split(" ")[1]
        if report_person in report_dict[reported_person]:
            pass
        else:
            report_dict[reported_person].append(
                report_person)

    for key, value in report_dict.items():
        if len(value) >= k:
            for val in value:
                answer[id_list.index(val)] += 1

    return answer
profile
사회에 이로운 IT 기술에 대해 고민하고 모두가 소외되지 않는 서비스를 운영하는 개발자를 꿈꾸고 있습니다 ✨

0개의 댓글