파이썬
def solution(id_list, report, k):
report = set(report)
report = list(report)
reportList = list() #[[a, b] [c, d] [e, f] [g, h] ...]
for i in report:
reportList.appned(i.split())
users = []
users_cnt = [0 for _ in range(len(id_list))]
for i in reportList :
users.append(i[1])
temp = []
for i in range(len(id_list)):
if users.count(id_list[i]) >= k :
temp.append(id_list[i])
for i in reportList:
if i[1] in temp:
users_cnt[id_list.index(i[0])] += 1
return users_cnt
print(solution(["muzi", "frodo", "apeach", "neo"], ["muzi frodo","apeach frodo","frodo neo","muzi neo","apeach muzi"], 2))