当前位置:网站首页>leetcode:84. The largest rectangle in the histogram

leetcode:84. The largest rectangle in the histogram

2022-06-24 06:40:00 Oceanstar's learning notes

Title source

Title Description

Given n Nonnegative integers , It is used to indicate the height of each column in the histogram . Each column is adjacent to each other , And the width is 1 . In this histogram , Can be sketched out rectangular The largest area of .

title

The question

 Insert picture description here

problem :

  • The request must be made in 0—>3 Make a high rectangle , The largest area
    • Left cannot be expanded
    • The right side cannot be expanded , because 1—>2 Than 0—>3 smaller
  • The request must be made in 1—>2 Make a high rectangle , The largest area

  • The request must be made in 2—>4 Make a high rectangle , The largest area
  • The request must be made in 3—>2 Make a high rectangle , The largest area
  • The request must be made in 4—>5 Make a high rectangle , The largest area
原网站

版权声明
本文为[Oceanstar's learning notes]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206240017131496.html