How do you break a palindrome loop?

If characters pointed by both the pointers are same, then increment left by one and decrement right by one. Else there is a mismatch and string is not palindrome thus break the loop. If left == right or left == right -1 then all the characters match and string is palindrome else not. Where s is your string.
For More Information Please Refer:
You May Also Like to Read: