0005. Longest Palindromic Substring
Find the longest palindromic substring in a string — 2 approaches
← 0004. Median of Two Sorted Arrays
0006. Zigzag Conversion →
Expand Around Center
Dynamic Programming
s =
babad
cbbd
a
racecar
🎲 Generate
Length:
6
8
12
16
Play
Pause
Step
Reset
Speed:
0.5x
1x
2x
4x
Press "Play" or "Step" to start the animation.
Algorithm Complexity
Brute Force
O(n³)
O(n³) / O(1)
Dynamic Programming
O(n²)
O(n²) / O(n²)
Expand Around Center
O(n²)
O(n²) / O(1)