function solution(record) {
var answer = [];
let infos=new Object();
for (let i=0;i<record.length;i++){
let [action, userId, name]=record[i].split(' ')
if (action==='Enter'){
infos[userId]=name;
}else if (action==='Change'){
infos[userId]=name;
}
}
for (let i=0;i<record.length;i++){
let [action, userId, name]=record[i].split(' ');
if (action==='Enter'){
answer.push(infos[userId]+'님이 들어왔습니다.')
}else if (action==='Leave'){
answer.push(infos[userId]+'님이 나갔습니다.')
}
}
return answer;
}