Largest Rectangular Area in Histogram






Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. 

For simplicity, assume that all bars have same width and the width is 1 unit.

SAMPLE INPUT: 

{6, 2, 5, 4, 5, 1, 6} 

SAMPLE OUTPUT
12

CODE

Comments

Popular posts from this blog

Female co passenger hack

C library function - qsort()

Wildcard Pattern Matching (DP)