HISTOGRAM area WA in all test cases

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)

@dhruvprashar please use type as long long to avoid overflow!