Problem 3359 · Medium

Find Sorted Submatrices With Maximum Element at Most K

Fix a left column, measure how far each row stays sorted and at most k, then count the blocks those widths allow.

Open the interactive visualisation