You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def solution(id_list, report, k):
answer = []
userDict = {id: [] for id in id_list}
resultDict = {id: 0 for id in id_list}
reportedUserDict = {id: 0 for id in id_list}
for i in set(report):
a, b = i.split()
userDict[a] += [b] # 신고한 사람
reportedUserDict[b] += 1 # 신고당한 사람
for i in reportedUserDict:
for j in userDict:
if reportedUserDict[i] >= k:
if i in userDict[j]:
resultDict[j] += 1
for i in resultDict:
answer.append(resultDict[i])
return answer
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
https://school.programmers.co.kr/learn/courses/30/lessons/92334
문풀 생각
Beta Was this translation helpful? Give feedback.
All reactions