문제 링크 Faulty Keyboard
/**
* @param {string} s
* @return {string}
*/
var finalString = function(s) {
let result = []
for(let el of s) {
if(el === 'i') {
result = result.reverse()
} else {
result.push(el)
}
}
return result.join('')
};