Array Game Codeforces Solution In Java