Maximum Subrectangle Problem This is a 2D version of the Maximum Subarray Problem. Here, we are given a matrix and we need to find the subrectangle with the largest sum. The maximum sum subarray is highlighted with blue rectangle and sum of this subarray is 29.