mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-12-02 17:31:08 +00:00
added largest rectangle histogram function
This commit is contained in:
parent
5c2d1fe725
commit
50d5bb1af3
|
@ -1,7 +1,7 @@
|
||||||
def largest_rectangle_area(heights: list[int]) -> int:
|
def largest_rectangle_area(heights: list[int]) -> int:
|
||||||
"""
|
"""
|
||||||
Given an array of integers representing the heights of bars,
|
Inputs an array of integers representing the heights of bars,
|
||||||
this function returns the area of the largest rectangle that can be formed
|
and returns the area of the largest rectangle that can be formed
|
||||||
|
|
||||||
>>> largest_rectangle_area([2, 1, 5, 6, 2, 3])
|
>>> largest_rectangle_area([2, 1, 5, 6, 2, 3])
|
||||||
10
|
10
|
||||||
|
|
Loading…
Reference in New Issue
Block a user