Solve the trapping rain water problem, got it mixed up with another problem at first, an max array should be computed instead of nearest max array.