Chef and String

my solution link is CodeChef: Practical coding for everyone
i don’t understand where am i wrong. please help me out.