Company: CodeSignal
Difficulty: medium
Largest Rectangle in a Stone Wall A wall contains `n` adjacent vertical slabs, each of width 1 and positive height. Find the maximum area of an axis-aligned rectangle that lies entirely within the wall. Input The first line contains `n`. The second line contains `n` slab heights. Output Print the maximum rectangle area. Constraints `1 ≤ n ≤ 200000`; each height is between `1` and `10^9`. Use 64-bit integers. Example Input: `8` and `4 1 5 3 3 2 4 1` Output: `10`