def solution(record): log = {} ment = [] answer = [] enter_chat = "님이 들어왔습니다." leave_chat = "님이 나갔습니다." for chat in record : temp = [] temp = chat.split(" ") if temp[0] == "Enter" : log[temp[1]] = temp[2] ment.append([temp[1], enter_chat]) elif temp[0] == "Leave" : ment.append([temp[1], leave_chat]) elif temp[0] == "Change" : log[temp[1]] = temp[2] for i in ment : answer.append(log[i[0]]+i[1]) r..