Kindly find the error in my code

Code -https://ide.codingblocks.com/s/229677

@7nishit
If(i.second>maxfreq) then update maxfreq also, you are just updating your ans. Simply write maxfreq=i.second if i.second>maxfreq

Oh yes!! I had missed that, Thanks!