[Solved] In a square matrix, where each cell is black or white. Design an algorithm to find the max white sub-square [closed]
First note that your solution is NOT O(n^2), it is more like O(n^4), because for each cell, you look for the largest matrix that can be of size up to O(n^2) itself, so it is totalling to O(n^4). It can be done however in O(n^2): First, define 2 auxillary functions (implemented as matrices): whitesLeft(x,y) = … Read more