Ayush7-BIT / turbo-robot

"A collection of essential coding algorithms and popular code solutions. Optimized for interviews and competitive programming, covering a wide range of topics from sorting to dynamic programming.”
26 stars 277 forks source link

Implement Finding Maximum area in a Histogram #298

Open Ansh-Vikalp opened 1 month ago

Ansh-Vikalp commented 1 month ago

Description:

Write a Java program to compute the maximum rectangular area in a histogram. Given an array where each element represents the height of bars in a histogram, the program should determine the largest possible rectangular area that can be formed using consecutive bars.

Test Cases:

Input: histogram = [6, 2, 5, 4, 5, 1, 6] Expected Output: 12

Input: histogram = [2, 1, 5, 6, 2, 3] Expected Output: 10

Constraints:

Histogram heights are non-negative integers

Histogram

Image taken from GFG

maniranjan2023 commented 1 month ago

@Ayush7-BIT sir, i want to contribute in this issue. kindly assign this issue to me