From a4164e540ea9ab5e8750b484da792fc06b7521f1 Mon Sep 17 00:00:00 2001 From: Sumit Chakraborty <40000937+chakraborty9569@users.noreply.github.com> Date: Mon, 17 Oct 2022 00:15:08 +0530 Subject: [PATCH] Problem #84 Largest Rectangle In Histogram (#76) --- C++/largest-rectangle-in-histogram.cpp | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 C++/largest-rectangle-in-histogram.cpp diff --git a/C++/largest-rectangle-in-histogram.cpp b/C++/largest-rectangle-in-histogram.cpp new file mode 100644 index 0000000..58bb447 --- /dev/null +++ b/C++/largest-rectangle-in-histogram.cpp @@ -0,0 +1,36 @@ +// Name: Sumit Chakraborty + +// Username: chakraborty9569 + +class Solution { +public: + int largestRectangleArea(vector& heights) { + stack s; + int max_area=0; + int tp; + int area_with_tp; + int i=0; + while(i