Palindrome with One Deletion
Updated
Problem statement
Given a string s, return true if it can become a palindrome after deleting at most one character. Otherwise, return false.
A palindrome reads the same from left to right and right to left. Keeping the string unchanged is allowed.
Function
validPalindrome(s: String) → booleanExamples
Example 1
s = "abca"return = trueDeleting b gives aca; deleting c gives aba.
Example 2
s = "abc"return = falseEach possible single deletion leaves two different characters.
Example 3
s = "aba"return = trueThe string is already a palindrome; no deletion is required.
Constraints
1 <= s.length <= 10000.scontains only lowercase English letters.
More WhatNot Phone Screen questions
- Merge Sorted Squares of Two ArraysPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- Adjacent Pair and Run RemovalPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- User Journey PathsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
- User Journey Paths from a Log StreamPHONE SCREEN · Seen Nov 2026
- Reachable Exits in an Obstacle GridPHONE SCREEN · Seen Oct 2026
- Search a 2D MatrixPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Attraction Route Without Reusing TrailsPHONE SCREEN · Seen Sep 2026
- Earliest Car for Each PassengerPHONE SCREEN · Seen Sep 2026
- Minimum Stores for a Shopping ListPHONE SCREEN · Seen Sep 2026
- Knight Dialer SequencesPHONE SCREEN · Seen Sep 2026
Similar questions at other companies
- Run-Length Encoding and DecodingAirbnb · PHONE SCREENAirbnb interview questions
- Check if a String Is a PalindromeCisco · PHONE SCREENCisco interview questions
- Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
- Reverse a StringAmazon · PHONE SCREEN
- Reverse a String ManuallyNewgen Software · PHONE SCREEN
- Reverse a String with Two PointersSnowflake · PHONE SCREENSnowflake interview questions
- Valid Word AbbreviationMeta · PHONE SCREENMeta interview questions
- Reverse a StringPersistent Systems · PHONE SCREEN
- Minimum Changes for Palindromic BlocksCitadel · OA · PHONE SCREEN · ONSITE INTERVIEWCitadel interview questions
- Valid Palindrome IIBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions