Editorial for ECOO '21 P2 - DNA Derren
Submitting an official solution before solving the problem yourself is a bannable offence.
A is the only vowel. We can compare every pair of consecutive characters. If both are
A, or neither are
A, we need to insert a space. Otherwise, we should not.
The first subtask is intended to reward inefficient solutions that, for example, split the string and copy it. To implement this efficiently, we can simply loop through the string and output the spaces as we go, requiring no splitting or extra memory.