My Accepted short Java Solution
\nclass Solution {\n    public int largestRectangleArea(int[] heights) {\n        int answer = 0;\n        for(int i = 0; i < heights.length; i++){\n           
```\nclass Solution {\n    public int largestRectangleArea(int[] heights) {\n        int answer = 0;\n        for(int i = 0; i < heights.length; i++){\n            int currentHeight = heights[i];\n            int left = i, right = i;\n            while(left >= 0 && heights[left] >= currentHeight) left--;\n            while(right < heights.length && heights[right] >= currentHeight) right++;\n            answer = Math.max(answer,((right -1) - (left + 1) + 1 )*currentHeight );\n            \n        }\n        \n        return answer;\n    }\n}\n```
['Java']