Kushal997-das / SkillShow

Welcome to the SkillShow repository! This is a collaborative space for beginners and intermediate programmers to showcase their skills through coding tasks and portfolio submissions. 💻✨
https://kushal997-das.github.io/SkillShow/
MIT License
24 stars 27 forks source link

Title: Implement Finding Maximum area in a Histogram #63

Open Ansh-Vikalp opened 17 hours ago

Ansh-Vikalp commented 17 hours ago

Initiative (Required)

Hacktoberfest 2024 🎃

Is your feature request related to a problem? Please describe.

Yes, the request addresses the problem of finding the maximum rectangular area in a histogram, which is a well-known problem in computational geometry and can be used in image processing, graphical applications, and other data visualizations.

Describe the solution you'd like.

The solution should efficiently compute the largest rectangular area that can be formed by consecutive bars in the histogram. This can be achieved using a stack-based approach to determine the boundaries of each rectangle. The solution should aim for a time complexity of O(n), where n is the number of bars in the histogram.

Add any other context or screenshots about the feature request here.

Example test cases:

Input: histogram = [6, 2, 5, 4, 5, 1, 6] → Output: 12 Input: histogram = [2, 1, 5, 6, 2, 3] → Output: 10

image from GFG

Image taken from Geek For Geeks

github-actions[bot] commented 17 hours ago

@Ansh-Vikalp

It's great having you contribute to this project

Thanks for opening this Issue 🙌 , Welcome to SkillShow 💖 We will review everything and get back to you.
Make sure to give a star to this repo before making a fork! Thank you :)