Largest Rectangle in Histogram

Hard

📝 Description

Find largest rectangular area under histogram

Input Format

Space-separated array of histogram heights

Output Format

Maximum area

Constraints

1 ≤ heights.length ≤ 10^5

🔍 Sample Input

2 1 5 6 2 3
            

✅ Sample Output

10
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run