Editorial - EXPALIN

thanks!!!

This line is not very efficient: temp = temp+S[cnt];

1 Like

Thanks buddy. Understood my mistake.
+= operator is much more efficient than + operator in case of concatenation (now no new copy of string is created).

From the same reason as anupam_datta in his question here. Do not pass string by value to a palindrome checking function.