Garbled Message
InterviewTime limit1sMemory limit128 MB
Read lines of garbled text until EOF and replace every occurrence of the substring "iiing" with "th", preserving all other characters and line breaks.
- Level
Easy2 of 10
- Topics
- String, Implementation, Simulation
- Solved
- No attempts yet
Problem
Obi-Wan has just sent an urgent message to the Jedi Temple, but subspace interference has garbled it: every occurrence of th in the original text was replaced with iiing. Reverse this substitution — replace every iiing back with th — to restore the original message.
Input
One or more lines of garbled text. Read every line until the end of input.
Output
The restored, original text: replace every iiing with th, and keep all other characters, line breaks, and whitespace exactly as they are.