-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path연습중
More file actions
23 lines (23 loc) · 724 Bytes
/
Copy path연습중
File metadata and controls
23 lines (23 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def solution(id_list, report, num):
newList = []
reported = []
result = []
for i in range(len(id_list)):
result.append(0)
for k in range (len(report)):
if report[k].split() not in newList:
newList.append(report[k].split())
for k in range (len(newList)):
reported.append(newList[k][1])
count= {}
for i in reported:
try: count[i] +=1
except: count[i]=1
for i in count:
if count[i] >=num:
for j in newList:
if j[1] == i:
for m in id_list:
if m == j[0]:
result[(id_list.index(m))] = result[(id_list.index(m))]+1
return result