Amazon | OnSite | Largest rectangle from an array of heights

It was a full technical online interview happened over Amazon Chime.

Problem Statement: Given an array of heights, calculate the area of largest rectangle which can be formed.

The question translates to https://leetcode.com/problems/largest-rectangle-in-histogram/

Example 1:
Input: [2,1,5,6,2,3]
Output: 10

Comments (1)