Goal:
Given an array of non-negative integers which represent histograms with width of 1 and height of the integer value. Find the largest area of any consecutive histograms can form. Intuition:
Max area must use one of the histogram as the height, thus we can calculate areas formed with every histogram…