Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Use converging two pointers from both ends. When a mismatch is found, try two options: skip the left character or skip the right character. Check if either remaining substring forms a palindrome. If so, the original string is a palindrome with one deletion.
A mismatch gives exactly two recovery options. Only one character can be removed, so trying both skip-left and skip-right covers all possibilities without backtracking.
Updated Feb 2026