Largest Square in the garden
Chef has a garden of size $N \times N$. The garden is divided into $N^2$ squares of size $1\times 1$ each. Chef has plants in some unit squares of the garden, because of which, that part looks *green*. Formally, for the $i^{th}$ row $(0 \le i \lt N)$, Chef has plants in all the columns from $A_i$ to $B_i$ (both inclusive) where $0 \le A_i \le B_i \lt N$. Help Chef find the **length** of the s
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.
Sign in to chat with the tutor and save your progress.
Sign in to start