Watch the two-pointer technique check if a string is a palindrome step by step.
A palindrome reads the same forwards and backwards. The two-pointer technique checks this in O(n) time by comparing characters from both ends moving inward.
Place a left pointer at index 0 and a right pointer at the last index. They move toward each other.
At each step, compare the characters at left and right. If they match, move both inward (left++, right--). If they differ, the string is not a palindrome.
If the pointers cross without finding a mismatch, the string is a palindrome. Time: O(n), Space: O(1).