Two pointers: check a palindrome from both ends

A palindrome reads the same forwards and backwards. Put one pointer left at the start and one right at the end, then walk them toward the middle. At each step compare the two letters: if they ever differ, it is not a palindrome. This reads the word — nothing is changed.

left left pointer right right pointer matched pair mismatch