Find the largest X pattern in a matrix


  • 0
    T

    I was asked this question - i didn't know the answer except the brute force method.

    Given a matrix of size m x n - each element is either a 0 or 1. One has to find the largest X pattern marked by all 1s. The center of the X has to be 1 also - so we cannot have this as a X:
    1 1
    1 1
    because the center of the X is not a 1 - just a blank. Can someone give clues as to how to do this faster.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.