Doubt about question frequency array retrieval.(From starters 70)

can anyone help me to understand where this code is failing or anyone here with codechef pro may you give me testcases of this problem please.

Problem link: Frequency Array Retrieval - Problems | CodeChef

My code: Solution: 94482102 | CodeChef

I know most of the test cases are failing so my logic might be wrong but still I am not getting what is wrong so please help me.