And my approach to this problem is whenever two L 's and two T’s and two I’s and two M’s and two E’s are present then i print “YES” otherwise “NO”.
and i think there is no modifications needed to string for getting output…
correct me if my approach is wrong.
I don’t think your approach will give the right answer for the test case LLTTIIMME.
Output must be ‘YES’ because the given string can be re arranged to LTIMEMITL.
Your code isn’t exactly checking the occurrence of those alphabets individually. It is only giving the total occurrence so something like TTTTTTTTTTTTTTTTTTTTTTTTT is giving output YES.
I have corrected what you said but again wrong answer
here check corrected solution it now runs two times per word of “LTIME”—CodeChef: Practical coding for everyone