Test cases not passing


here is my code pls tell why test cases are not passing because code is running properly

hello @professor
please explain ur approach

i hv made 2 arrays left and right in which i hv stored index value of nearest smallest element for each height(if no such element is found in left i hv pushed -1 in array and for right i hv pushed n) after that i hv calculated width by (right-left-1) and then i am multiplying widht by heaight. after that i sort area vector so to get max area at end

Yeah the approach is correct, wait i m checking

once try long long in place of int and submit

yes thanks it worked