Kindly find the error in my code
@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!
@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!