It is giving wrong answer for testcases.
Please tell the error.
Question :
HISTOGRAM
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars.
Input Format:
First line contains a single integer N, denoting the number of bars in th histogram. Next line contains N integers, ith of which, denotes the height of ith bar in the histogram.
Constraints:
1<=N<=10^6 Height of each bar in histogram <= 10^9
Output Format
Output a single integer denoting the area of the required rectangle.
Sample Input
5
1 2 3 4 5
Sample Output
9