Why is it not passing test cases

on my computer it is giving the correct answer

image

Here Height of each bar in histogram can be 10^10…
so you have to increase the size of integer variable as “long long int” :

#define int long long int
int32_t main(){

Modified Code is:

i Hope this helps…