def solution(id_list, report, k):
answer = []
Declareddic = {}
n = len(id_list) #total number of users
for x in id_list:
Report dic[x] = []
for i in report:
reporter = i.split("") #["muzi", "frodo"] Reported, reported
신고dic[reporter[1]] += reporter[0]
forkin reporting.dic:
answer.append(len(set(k)))
return answer
Python tutor identified a problem and reported dic[reporter[1] +=reporter[0] I don't know how to solve the problem of adding "m", "u", "z", and "i" instead of having "muzi" strings in the list at once. I wonder if the problem-solving approach is wrong from the beginning or if I only have to solve the problem in that part.
python python3 dictionary
>>> a = []
>>> a += "abcde"
>>> a
['a', 'b', 'c', 'd', 'e']
>>> a = []
>>> a.append("abcde")
>>> a
['abcde']
© 2024 OneMinuteCode. All rights reserved.