Question
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. I need to try
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.
I need to try and solve this problem using c++, but I have some problematic restrictions. I am ONLY allowed to use the iostream package, and I am NOT allowed to use vectors, bit manipulation, commands that uses a period, and I am not allowed to create or use any functions. I am ONLY allowed to use the c++ basics (variable creation, basic math, cout and cin, comparative expressions, etc), if statements, loops, and arrays/matrices.
is something like this even possible?
61. Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. A. Example: i. Input: [ [1, 0, 1, 0, 0], [1.0, 1, 1, 1], [1, 1, 1, 1, 1], [1, 0, 0, 1, 0] ] ii. Output: 6
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