Over a million developers have joined DZone.

Thursday Code Puzzler: Get The Size of X

· Performance Zone

Download Forrester’s “Vendor Landscape, Application Performance Management” report that examines the evolving role of APM as a key driver of customer satisfaction and business success, brought to you in partnership with BMC.

It's Thursday, so it's time for another code puzzler. The idea is simple: solve the coding problem as efficiently as you can, in any language or framework that you find suitable.

Note: Even though there really is nothing stopping you from finding a solution to this on the internet, try to keep honest, and come up with your own answer.  It's all about the participation!

Create 24

Given a matrix of 1s and 0s, find the largest possible X made from 1's. 

For example in the following matrix 
101
010 
101
The size of X is 3, as the diagonal contains 3 1's.
The following would be invalid (i.e. 0) as there is no '1' at the center of an X shape
010
101


Catch up on all our previous puzzlers here

See Forrester’s Report, “Vendor Landscape, Application Performance Management” to identify the right vendor to help IT deliver better service at a lower cost, brought to you in partnership with BMC.

Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}