Interview Program – Matrix

Find if there is a rectangle in binary matrix with corners as 1.

Input: mat[][] = {{1, 0, 0, 1, 0}, {0, 0, 1, 0, 1}, {0, 0, 0, 1, 0}, {1, 0, 1, 0, 1}}
Output: YES
Note: as there exists – 
           1 0 1
           0 1 0
           1 0 1





Thanks and Regards,
Solution provided by Nilmani Prashanth

About the author

Bushan Sirgur

Well, I am Bushan Sirgur from Banglore, India. Currently, I am working as a Software Developer in a Service Base Company. I am interested in JAVA/J2EE, Angular 2, JavaScript, jQuery, MongoDB.

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *