What is the problem in this code of historam it gives wrong output
@rohitkandpal683
N can be upto 10^6 and maximum height of each histogram can be 10^9. So maximum possible ans is upto 10^15 which can’t be stored in int. Use long long int everywhere, your code will work fine.