← All problemsSign in

Area Queries

There are $n$ plates placed adjacent to each other having width of $1$ unit each and having different heights $h_1, h_2, h_3, ... h_n$. You can't change the order of the plates. Area of consecutive block of plates can be described as area of the rectangle formed by width equal to the number of plates in the block and height equal to the minimum of the heights of the plates in the block. You are

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