Given an array heights of bar heights (width 1 each), return the area of the largest rectangle that fits inside the histogram.
Input: one line of space-separated integers. Output: the maximum area.
2 1 5 6 2 3
10
Bars 5 and 6 give 5 × 2 = 10.
2 4
4
Run your code against the sample tests, or Submit to run the full suite.