apple pie's submission of Alternating String | CodeChef