Brachiosaurus is trying to become a detective by writing words in codes. It manipulates…
- User
Brachiosaurus is trying to become a detective by writing words in codes. It manipulates each word in a sentence by putting the letter 'z' after each vowel, followed by that very vowel. Eg- "belina" translates into "bezelizinaza" and "zazhiba" translates into "zazazhizibaza". A team of secret agents want to decode the sentences of Brachiosaurus. Write a program that decodes Brachiosaurus's coded sentences. Input The coded sentence is given on a single line. The sentence comprises only of lowercase letters of the English alphabet and spaces. The words will be separated by exactly one space and there will be no spaces at beginning or end. The number of characters (total) will be 100 at the max.
Output The decoded sentence is to be outputted on a single line.
Example
Input: razat geze hozotazamnaza ozoraza bezehizisaza
Output: rat ge hotamna ora behisa
Assistant
pythonsentence = input().strip() words = sentence.split() vowels = {'a', 'e', 'i', 'o', 'u'} decoded_words = [] for word in words: decoded = [] i = 0 while i < len(word): if word[i] in vowels: if i + 2 < len(word) and word[i+1] == 'z' and word[i+2] == word[i]: decoded.append(word[i]) i += 3 else: decoded.append(word[i]) i += 1 else: decoded.append(word[i]) i += 1 decoded_words.append(''.join(decoded)) print(' '.join(decoded_words))
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.