Codeforces The Good Array Hackerrank Solution