WHY TLE ???

Was trying to solve KAN13C Problem - CodeChef .
but its giving TLE though it almost matches with the codes submitted with AC.
eg-CodeChef: Practical coding for everyone.
AND here is mine CodeChef: Practical coding for everyone
plz give reasons as Why my code takes longer than it though both time complexity is O(N).N=lenght of text.

Please provide the link which is proper!!
Such a link does not exist!

help …:frowning:

I fixed the link - it’s bad formatting here at forum…