All square submatrix of a matrix

Sir, how can we extract all square submatrix of an NxM matrix? Please explain the logic and approach. Don’t send the code for it. I’ll try the coding part myself.

hello @gaurisha

decide what can be maximum side of square SIDE = min(N,M)

iterate from length L=1 ...SIDE 
        go to each cell (i,j) of matrix and print L length square. whoose upper left veretx is at (i,j)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.