Valid Palindrome II
Given a string s, return true if s can be made a palindrome by deleting at most one character (deleting zero characters is allowed, so an already-palindromic string qualifies).
Open official problem prompt ↗Decide whether the string is at most one deletion away from reading the same forwards and backwards.
Reading a word aloud from both ends toward the middle; if one letter is out of place you get a single 'mulligan' to cover it, then everything else must line up.
- Input
- s = "abca"
- Output
- true
- Why
- Deleting 'c' leaves "aba", which is a palindrome.
1 <= s.length <= 10^5s consists of lowercase English letters