File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 55λ§ν¬ : https://school.programmers.co.kr/learn/courses/30/lessons/42888
66*/
77
8+ // ANCHOR - 2025.12.07 νμ΄
9+ function solution ( record ) {
10+ const userMap = new Map ( ) ;
11+ for ( let idx = 0 ; idx < record . length ; idx ++ ) {
12+ const [ type , uid , name ] = record [ idx ] . split ( " " ) ;
13+ if ( type === "Enter" || type === "Change" ) {
14+ userMap . set ( uid , name ) ;
15+ }
16+ }
17+
18+ const answer = [ ] ;
19+ for ( let idx = 0 ; idx < record . length ; idx ++ ) {
20+ const [ type , uid , _ ] = record [ idx ] . split ( " " ) ;
21+ if ( type === "Enter" ) answer . push ( `${ userMap . get ( uid ) } λμ΄ λ€μ΄μμ΅λλ€.` ) ;
22+ else if ( type === "Leave" )
23+ answer . push ( `${ userMap . get ( uid ) } λμ΄ λκ°μ΅λλ€.` ) ;
24+ }
25+
26+ return answer ;
27+ }
28+
829// ANCHOR 2025.10.06 νμ΄
930function solution2 ( record ) {
1031 const nicknameMap = new Map ( ) ; // key: μ μ μμ΄λ, value: νμ¬ λλ€μ
You canβt perform that action at this time.
0 commit comments