How To Use Array Reduce Function Hackerrank