728x90 반응형 maxChars1 문자열 내 최빈값 구하기(MaxChars) References 아래 링크의 강의 중 Section 6. MaxChars의 내용을 추려 이번 글을 작성하였습니다. The Coding Interview Bootcamp: Algorithms + Data Structures on Udemy Solution 1. my solution function maxChar(str) { const splited = str.split(""); let cnt = ""; const cntArr = []; for (let i = 0; i splited[i] === el).length; cntArr.push(cnt); } const maxCnt = [...cntArr].sort(.. 2022. 4. 4. 이전 1 다음 728x90 반응형