Getting WA on a cake-walk simple problem. Please help!!

c-plus-plus
cakewalk
compare
string

#1

I read the Editorial. It’s basically the same thing. Still getting WA. I’m very confident that the code is correct :frowning: Please please review. My life is at a standstill :frowning:

Problem:
http://www.codechef.com/problems/GRANAMA

My submission:
http://www.codechef.com/viewsolution/3105197


#2

temp1 = temp2 doesnt justify that chef guessed it is true.

consider

abcd efgh

here temp1 = temp2 but chef ans should be false;


#3

You can check out my submission

http://www.codechef.com/viewsolution/3106021

its in C but C and C++ are pretty similar


#4

Thanks a lot!