Biggest Billboard Under the Skyline
A skyline is a row of buildings standing side by side with no gaps. Building i is widths[i] wide and heights[i] tall. A billboard is a rectangle that stands on the ground and covers a run of one or more neighbouring buildings in full: its width is the sum of their widths, and its height is the height of the shortest building in the run, because it must fit under all of them.
Return the largest possible area of a billboard. A building of height 0 can only be part of a billboard of area 0.
Example 1
All buildings are 1 wide, so this is the classic skyline 2,1,5,6,2,3: the buildings of height 5 and 6 give a billboard 2 wide and 5 tall.
Example 2
The first building alone gives 2 * 3 = 6, the last alone gives 3 * 2 = 6, and all three together give width 6 at height 1, also 6.
Constraints
1 <= len(widths) == len(heights) <= 1001 <= widths[i] <= 200 <= heights[i] <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.