I am getting the correct answer for the given test case but while submitting I am getting run error in all the test cases.
so please tell me what I am doing wrong.
Run error in histogram
I have edited your code… Try to submit it now…
This worked thanks 