Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given a matrix that contains only the characters ' 0 ' and ' 1 ' , find the biggest plus sign ( + ) formed
Given a matrix that contains only the characters
and find the biggest plus sign formed by s in this matrix and return its size.
Size, in this case, indicates the length of the plus sign's edges. In order to be a valid plus sign, the edges must be of equal length.
For example, a plus sign with a size of k in matrix starts at cell x y The plus sign's edges are x k yx k y
x k y and x y kx y k
x y k all with a length of k
Example
For
main.cg
matrix
the output should be solution matrix
Here, the biggest plus sign is centered at cell
Obased and has a size of since the downward facing edge is short.
InputOutput
execution time limit seconds cpp
memory limit GB
input array.string matrix
A matrix containing only the symbols and It is guaranteed that there is at least one in matrix.
Guaranteed constraints:
inputArray. length
inputArrayi Tength
output integer
The size of the biggest plus sign formed by I sin matrix.
C Syntax Tips
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started