Tap here to switch tabs
Problem
Submissions

Problem: Faulty Keyboard

med
30 min
Try to solve the Faulty Keyboard problem.

Statement

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:

  • 1≤1 \leq s.length ≤100\leq 100

  • s consists of lowercase English letters.

  • s[0] ≠\neq 'i'

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Faulty Keyboard

med
30 min
Try to solve the Faulty Keyboard problem.

Statement

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:

  • 1≤1 \leq s.length ≤100\leq 100

  • s consists of lowercase English letters.

  • s[0] ≠\neq 'i'