arrow_back Back to Challenges

#84 Largest Rectangle in Histogram

Hard Acceptance 0%
description

Problem Description

Given an array of integers `heights` representing the histogram's bar height where the width of each bar is `1`, return the area of the largest rectangle in the histogram.

checklist Constraints

1 <= heights.length <= 10^5
0 <= heights[i] <= 10^4

science Examples

Case #1

In: heights = [2,1,5,6,2,3]
Out: 10

Case #2

In: heights = [2,4]
Out: 4

Mastery Tags

Arrays Stack

Hiring Companies

Amazon Google Microsoft
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude