Consecutive 1's in a matrix

ques link https://hack.codingblocks.com/contests/c/526/919
how to solve these type of questions in which we want largest square or rectangle submatrix of all 1’s

You can use DP, all you need to do is find the proper reccurence relation.

sir i am not able to find a recurrence for such type of ques. sir please help to solve this

sir please tell how to find a recurrence in these questions

refer this page for some insight