Doubt on 2d matrix

The question is: Given two binary matrix find the largest submatrix that matches in both the images.

Could you tell me how to approach this problem?

Take xor of both the arrays element wise and negate it i.e 1^(a[i][j]^b[i][j])
Then find the largest submatrix having all 1s in it

This should work

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.