l*n
1 楼
Give a square matrix with n x n cells. Each cell is either filled with a
black pixel or a white pixel. Design an algorithm to find the maximum
subsquare such that all four borders are filled with black pixels;
Note: it is not the same as the wellknown question for the max sub-matrix
with all filled 0/1.... so the DP equation does not apply here..
Any good approach better than brute force?
black pixel or a white pixel. Design an algorithm to find the maximum
subsquare such that all four borders are filled with black pixels;
Note: it is not the same as the wellknown question for the max sub-matrix
with all filled 0/1.... so the DP equation does not apply here..
Any good approach better than brute force?