Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Valid Palindrome II
Bookmark
Brute Force
Two Pointers
Input
Skip one
Already palindrome
Not possible
Skip one (longer)
Custom
s
=
abca
s
0
1
2
3
a
b
c
a
candidate
removed
nothing yet
comparisons
0
s
0
1
2
3
a
b
c
a
candidate
removed
nothing yet
comparisons
0
s
0
1
2
3
a
b
c
a
candidate
a
b
c
a
removed
nothing yet
comparisons
0
s
0
1
2
3
a
b
c
a
candidate
a
b
c
a
i
j
removed
nothing yet
comparisons
1
s
0
1
2
3
a
b
c
a
candidate
a
b
c
a
i
j
removed
nothing yet
comparisons
2
s
0
1
2
3
a
b
c
a
candidate
b
c
a
removed
s[0]
comparisons
2
s
0
1
2
3
a
b
c
a
candidate
b
c
a
i
j
removed
s[0]
comparisons
3
s
0
1
2
3
a
b
c
a
candidate
b
c
a
i
j
removed
s[0]
comparisons
3
s
0
1
2
3
a
b
c
a
candidate
a
c
a
i
j
removed
s[1]
comparisons
4
s
0
1
2
3
a
b
c
a
candidate
a
c
a
removed
s[1]
comparisons
4
s
0
1
2
3
a
b
c
a
candidate
a
c
a
removed
s[1]
comparisons
4
one removal is enough
algo
master
.
io
Step:
Start: can "abca" become a palindrome by removing at most one character?
0 / 11
Input
Skip one
Already palindrome
Not possible
Skip one (longer)
Custom
s
=
abca
0 / 11
algo
master
.
io
Step:
Start: can "abca" become a palindrome by removing at most one character?