Why this histogram code is not working?

No need to answer I just replaced int with long long and it worked