Given a string s, you are typing each character into a faulty laptop keyboard.
Whenever you type a character that is not 'i', that character is appended to the text on the screen. Whenever you type the character 'i', the text currently on the screen is reversed instead of appending the letter 'i'.
Return the final string displayed on the screen after typing all characters in s.
Constraints:
s.length
s consists of lowercase English letters.
s[0] 'i'
Given a string s, you are typing each character into a faulty laptop keyboard.
Whenever you type a character that is not 'i', that character is appended to the text on the screen. Whenever you type the character 'i', the text currently on the screen is reversed instead of appending the letter 'i'.
Return the final string displayed on the screen after typing all characters in s.
Constraints:
s.length
s consists of lowercase English letters.
s[0] 'i'