Wave Pattern Rearrangement - Coding problem | OneNoughtOne