
s에서 1의 수를 확인function maximumOddBinaryNumber(s: string): string {
let countOne = 0
for(const char of s) {
if(char === '1') {
countOne++
}
}
const splitted = [...s]
countOne--
splitted[splitted.length - 1] = '1'
for(let i = 0; i < splitted.length - 1; i++) {
if(countOne) {
splitted[i] = '1'
countOne--
} else {
splitted[i] = '0'
}
}
return splitted.join('')
};