You are given the heights of storage racks arranged in a single row inside a warehouse. A robotic crane needs to clear a rectangular region of racks. For each rack i, the crane can clear a rectangle whose height is the height of rack i, extending left and right to the farthest racks it can reach without hitting any rack that is shorter than rack i (a rectangle of height h can only span racks with height >= h). Your job is to compute, for every rack i, the maximum area of such a rectangle centered at using rack i as the limiting (shortest) height, then return the single largest area achievable across the whole row. Return just that one maximum area as an integer.
No one has cracked it yet. Be the first.