Valid Palindrome II - Practice Coding | SlaveCode
Problems
Scratchpad
Run
Submit
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
:
0
0
1
2
3
4
5
6
7
8
9
0
0
1
2
3
4
5
6
7
8
9
Toggle theme (Current: Custom)
Scratchpad
Run
Submit
Description
Hints
Solutions
680. Valid Palindrome II
Easy
10 Points
Two Pointers
String
Greedy
Given a string s, return true if the s can be palindrome after deleting at most one character from it.
Examples
Example 1
Input: s = "aba" Output: true
Example 2
Input: s = "abca" Output: true Explanation: You could delete the character 'c'.
Example 3
Input: s = "abc" Output: false
Constraints
1 <= s.length <= 105
s consists of lowercase English letters.
JAVASCRIPT
Code
Tests
Result
Description
Hints
Solutions
680. Valid Palindrome II
Easy
10 Points
Two Pointers
String
Greedy
Given a string s, return true if the s can be palindrome after deleting at most one character from it.
Examples
Example 1
Input: s = "aba" Output: true
Example 2
Input: s = "abca" Output: true Explanation: You could delete the character 'c'.
Example 3
Input: s = "abc" Output: false
Constraints
1 <= s.length <= 105
s consists of lowercase English letters.
JAVASCRIPT
Code
Tests
Result