We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba1af42 commit 8060d49Copy full SHA for 8060d49
1 file changed
live8/test81/문제3/박희경.py
@@ -0,0 +1,21 @@
1
+from collections import *
2
+
3
4
+def solution(records):
5
+ result = []
6
+ answer = []
7
+ user = defaultdict()
8
+ for record in records:
9
+ cmd = list(map(str, record.split()))
10
+ if cmd[0] != 'Leave': # {유저 아이디: 닉네임}
11
+ user[cmd[1]] = cmd[-1]
12
+ if cmd[0] != 'Change':
13
+ result.append([cmd[0], cmd[1]])
14
15
+ for res in result:
16
+ if res[0] == 'Enter':
17
+ answer.append(user[res[1]] + "님이 들어왔습니다.")
18
+ if res[0] == 'Leave':
19
+ answer.append(user[res[1]] + "님이 나갔습니다.")
20
21
+ return answer
0 commit comments