function FF(str){ let index = 0 let count2 = 0 let arr = [] let obj = {} let maxNum = 0 for(let i = 0; i < str.length; i++){ let count = 0 for(let j = 0; j < str.length; j++){ if(str[i] === str[j]){ count = count + 1 } } if(count > maxNum){ maxNum = count } if(str[i] !== ' '){ obj[str[i]] = count } arr.push(str[i]) } for(let v = 0; v < arr.length; v++){ if(arr[0] === arr[v] && arr[v] === ' '){ result = result + ' ' } for(let el2 in obj){ if(el2 === arr[v] && obj[el2] === maxNum){ count2 = count2 + 1 index = v } } } for(let l = 0; l < arr.length; l++){ for(let el3 in obj){ if(el3 === arr[l] && obj[el3] === maxNum){ return arr[l] } } } // TODO: 여기에 코드를 작성합니다. }function FF(str){ let result = '' let index = 0 let obj2 = {} let strArr = [] let obj = {} let maxNum = 0 for(let i = 0; i < str.length; i++){ let count = 0 for(let j = 0; j < str.length; j++){ if(str[i] === str[j]){ count = count + 1 } } if(count > maxNum){ maxNum = count } if(str[i] !== ' '){ obj[str[i]] = count } strArr.push(str[i]) } for(let v = 0; v < strArr.length; v++){ if(strArr[0] === strArr[v] && strArr[v] === ' '){ result = result + ' ' } for(let el2 in obj){ if(el2 === strArr[v] && obj[el2] === maxNum){ obj2[str[v]] = v } } } for(let el3 in obj2){ for(let el4 in obj2){ if(obj2[el3] > obj2[el4]){ index = obj2[el4] console.log(index) } } console.log(index) result = strArr[index] } console.log(obj) console.log(obj2) console.log(strArr) console.log(maxNum) return result // TODO: 여기에 코드를 작성합니다. }