Question: write a java program for the following question: Given a square matrix with the elements 0 and 1, write a program to find a maximum
write a java program for the following question:

Given a square matrix with the elements 0 and 1, write a program to find a maximum square submatrix whose elements are all 1s. The program first prompts the user to enter the number of rows in the matrix and then the rows, one by one. The output produced by the program consists of the location of the first element in the maximum square submatrix (the left top corner element in the printed matrix) plus the number of rows in that submatrix. Sample run: Enter the number of rows in the matrix: 5 Enter the matrix row by row: 1 1 1 0 1 0011 1 1 01 1 1 0 1 1 1 1 The maximum square submatrix is at (2,2) with size 3. You don't have to consider input exceptions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
