Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Longest Palindrome
Bookmark
Hash Map
Single Pass
Input
Standard (ans: 7)
Single char (ans: 1)
All pairs (ans: 6)
Custom
s
=
abccccdd
a
b
c
c
c
c
d
d
counts
length =
0
a
b
c
c
c
c
d
d
counts
length =
0
a
b
c
c
c
c
d
d
i
counts
a:1
b:1
length =
0
a
b
c
c
c
c
d
d
i
counts
a:1
b:1
c:2
length =
0
a
b
c
c
c
c
d
d
i
counts
a:1
b:1
c:4
length =
0
a
b
c
c
c
c
d
d
i
counts
a:1
b:1
c:4
d:2
length =
0
a
b
c
c
c
c
d
d
counts
a:1
b:1
c:4
d:2
length =
0
a
b
c
c
c
c
d
d
counts
a:1
b:1
c:4
d:2
length =
0
a
b
c
c
c
c
d
d
counts
a:1
b:1
c:4
d:2
length =
0
a
b
c
c
c
c
d
d
counts
a:1
b:1
c:4
d:2
length =
6
a
b
c
c
c
c
d
d
counts
a:1
b:1
c:4
d:2
length =
7
algo
master
.
io
Step:
Start: find the longest palindrome that can be built from "abccccdd"
0 / 17
Input
Standard (ans: 7)
Single char (ans: 1)
All pairs (ans: 6)
Custom
s
=
abccccdd
0 / 17
algo
master
.
io
Step:
Start: find the longest palindrome that can be built from "abccccdd"