Let's trace s = "abdca".
Pointers start at left = 0 ('a') and right = 4 ('a'). Match. Move inward.
left = 1 ('b'), right = 3 ('c'). Mismatch. Try skipping left: is "dca" a palindrome? No. Try skipping right: is "bd" a palindrome? No. Return false.
The outer scan is . Each inner palindrome check is also in the worst case, but it runs at most once. Total: time, space.