Problem 363 · Hard

Max Sum of Rectangle No Larger Than K

Find the maximum sum of a rectangle in a 2D matrix that does not exceed K.

Open the interactive visualisation