Array Reduction 1 Hackerrank Practice