DSA Not All Flavours

could anyone help with the solution, i am getting wrong answer.
Thanks in advance.
https://www.codechef.com/viewsolution/32134901

problem figured out. I didn’t initialise the frequency count array to 0.