Over a million developers have joined DZone.

Thursday Code Puzzler: Get The Size of X

DZone's Guide to

Thursday Code Puzzler: Get The Size of X

· Performance Zone ·
Free Resource

Container Monitoring and Management eBook: Read about the new realities of containerization.

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 
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

Catch up on all our previous puzzlers here

Take the Chaos Out of Container Monitoring. View the webcast on-demand!


Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}