Array Game Codeforces Solution