You can build an extra recursive function which gets as arguments a currect row and col, and looks for a square in any size from it.
From your other function, aftter the extra function returns a value, you have to make 2 calls:
one from (row,col+1) and the other 1 from (row+1,col).
This is a backtracking usage, we check all the options.