DSA Not all flavours - partial pass

question link

I kept track of all occurring flavours in an unordered map, and when the map size becomes equal to k, I check for max and clear the map. I am not sure where i am going wrong…

https://www.codechef.com/viewsolution/46515911