Please help

```
class Solution {
public:
int largestRectangleArea(vector<int>& heights) {
if(heights.size()==0)return 0;
int max =0;
for(int i=0;i<heights.size();i++){
if(heights[i]>max)max= heights[i];
int count = 1;
for(int j=i-1;j>=0;j--){
if(heights[i]<=heights[j])count++;
else break;
}
for(int j=i+1;j<heights.size();j++){
if(heights[i]<=heights[j])count++;
else break;
}
int area = count*heights[i];
if(area>max)max=area;
}
return max;
}
};
```