Answer: Meta OA Question 2024 April | Two Pointers & Strings | on-campus

Answer · Posted Jun 2026

Solution: Valid Palindrome — Two Pointers Approach Instead of copying the string or allocating new memory for a filtered string, we can verify the palindrome in-place using **Two Pointers**: We place one pointer at the start (left = 0) and another pointer at the end (right = s.length() - 1). At each step, we check if the characters at left and right are alphanumeric. If they are not, we skip them by moving the respective pointer inward. Once both pointers ...

The full answer & interview discussion are available to premium members.

Log in Create a free account