Why iam getting wrong answer

my problem link is


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.


Same problem with my code but i have overcome the exception you told but again it showing wrong answer while submitting.

@shyguy99 What’s your approach?

HERE CHECK MY CODE------https://www.codechef.com/viewsolution/24949917

in your code in 16line your statement print(o) printing unnecessary data will leads to wrong answer

Ohh sorry i forgot to remove it
But after removing it again showing wrong ans :frowning_face:
check here i have removed it–https://www.codechef.com/viewsolution/24957892

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 :expressionless: :disappointed:
here check corrected solution it now runs two times per word of “LTIME”—https://www.codechef.com/viewsolution/24958201

You just have to make the YES and NO capital. Gave AC after that change.

1 Like

WTF!!!:expressionless::expressionless: because of this capital small thing the whole thing messed up.Now ans is correct.
THANK YOU BRO :heart::heart: :heart: