largest row-wise and column-wise sorted sub-matrix | histogram logic not working
Anonymous User
843

Given an N * M matrix mat[][], the task is to find the area-wise largest rectangular sub-matrix such that each column and each row of the sub-matrix is strictly increasing.

https://www.gfg.org/largest-row-wise-and-column-wise-sorted-sub-matrix/

This solution has been implemented using same soultion as histogram problem[https://leetcode.com/problems/largest-rectangle-in-histogram/]

This does not work for input like:
{ { 1, 2},
{ 0, 3}
};
output -> 4
correct 2
Can someone give different approach to solve this?

Comments (0)