s
를 공백을 기준으로 분리function sortSentence(s: string): string {
const splitted = s.split(" ")
const sorted = new Array(splitted.length)
for(const word of splitted) {
const n = word.length
const idx = word.slice(n - 1)
const onlyStr = word.slice(0, n - 1)
sorted[Number(idx) - 1] = onlyStr
}
return sorted.join(' ')
};