Hackerank nutanix interview problem


Please help me out with this problem

see:

  1. Negative values possible.
  2. Maximum sum can be less than zero.
  3. Range of element value is -9 to 9.
  4. Numbers to be summed for each hourglass = 7.
  5. Minimum possible value for sum = 7*-9=63

So we’ll initialize our maxSum to -63. From there, we just calculate the sums of all hourglasses and return the maxSum