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.”
13 stars 194 forks source link

Implement Finding Maximum area in a Histogram #298

Open Ansh-Vikalp opened 3 days ago

Ansh-Vikalp commented 3 days 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 3 days ago

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