Explore Westonci.ca, the top Q&A platform where your questions are answered by professionals and enthusiasts alike. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.

You are given a 2D binary array grid. You need to find 3 non-overlapping rectangles having non-zero areas with horizontal and vertical sides such that all the 1's in grid lie inside these rectangles.

Return the minimum possible sum of the area of these rectangles.

Note that the rectangles are allowed to touch.



Example 1:

Input: grid = [[1,0,1],[1,1,1]]

Output: 5

Solve this question in java.

Sagot :

Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. We appreciate your visit. Our platform is always here to offer accurate and reliable answers. Return anytime. Find reliable answers at Westonci.ca. Visit us again for the latest updates and expert advice.