오픈채팅방1 [프로그래머스][자바스크립트][Level2][카카오] 오픈채팅방 function solution(record) { const uidToName = record.reduce((obj, item) => { const itemArr = item.split(" "); if (!obj[itemArr[1]]) { obj[itemArr[1]] = itemArr[2]; } else if (itemArr[0] === "Enter" || itemArr[0] === "Change") { obj[itemArr[1]] = itemArr[2]; } return obj; }, {}); const answer = record.reduce((arr, item) => { const itemArr = item.split(" "); if (state[itemArr[0]]) { arr.push(`${ui.. 2021. 7. 22. 이전 1 다음