have tried 2 methods passing the given test but giving WA for all test cases
standard method
method 2: finding nearest smaller height’s index to right and left side of ith element and then using formula area=height[i]*(right-Left-1)
have tried 2 methods passing the given test but giving WA for all test cases
standard method
method 2: finding nearest smaller height’s index to right and left side of ith element and then using formula area=height[i]*(right-Left-1)