Find Largest X Shape in Matrix
Given a binary matrix of 0s and 1s, find the largest X shape formed by 1s. Return the size of the largest such X pattern found in the matrix.
Asked at:
Capital One
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early November, 2026
Senior
Given a matrix of 0s and 1s, find the largest X of ones, basically do a DFS going in each direction and checking edge boundaries throughout and compare the size with all the previous sizes.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.