Unit Array Codeforces Solution