PIXELBANKv9.1.0
Menu

Given a string s, return True if s can be a palindrome after deleting at most one character.

Example:

Input:
aba
Output:
True
Reasoning:
  • The input string s is "aba", which is already a palindrome since it reads the same backward as forward.
  • No character needs to be deleted to make it a palindrome.
  • The condition of deleting at most one character is satisfied, as no deletion is required.
  • The function returns True, indicating that the string can be a palindrome after deleting at most one character.

Constraints:

  • 1 <= len(s) <= 10^5
  • s consists of lowercase English letters
🔒

Editor locked

The code editor is locked for Pro problems. It is only available for free problems. Please upgrade to gain access to the code editor for all problems.

solution.py

Test Results

0/0
Run code to see test results.
Valid Palindrome II - Easy | PixelBank