← All problemsSign in

Area of Largest Rectangle

Suppose you are a farmer in village X. Due to heavy rainfall, some parts of the village are submerged in water. The village is represented as a matrix of 1’s and 0’s, where 1’s represents the parts of the land which are not submerged in water. As a farmer, you want to acquire a piece of land in a rectangular shape in this village X. Find the largest rectangle containing only 1's and return its

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start