You are viewing a single comment's thread. Return to all comments →
//My C Language Code
long largestRectangle(int h_count, int* h) {
long max=LONG_MIN; int count=0; int mul; for(int i=0;i<h_count;i++){ for(int k=i;k>=0;k--){ if(h[i]<=h[k]){ count++; } else break; } for(int j=i+1;j<h_count;j++){ if(h[i]<=h[j]){ count++; } else break; } mul=h[i]*count; count=0; if(max < mul) max=mul; } return max;
}
Largest Rectangle
You are viewing a single comment's thread. Return to all comments →
//My C Language Code
long largestRectangle(int h_count, int* h) {
}