Skip to main content
LeetCode 680, Easy. Topics: Two Pointers, String, Greedy. View on LeetCode. Generate this problem as a practice environment: tested reference solution, 18 parametrized pytest cases, and a playground notebook:

Problem

Given a string s, return true if the s can be palindrome after deleting at most one character from it.

Examples

Constraints

  • 1 <= s.length <= 10^5
  • s consists of lowercase English letters.

Solution

Reference implementation from solution.py on GitHub, full suite in test_solution.py:

Complexity

Tags

NeetCode 250, NeetCode All.
Last modified on August 25, 2026