Given a string s, return its longest palindromic substring: the longest run of consecutive characters that reads the same forward and backward.
Every test has exactly one answer.
Examples
Example 1
- Input
- s = "cbbd"
- Output
- "bb"
Example 2
- Input
- s = "forgeeksskeegfor"
- Output
- "geeksskeeg"
Example 3
- Input
- s = "a"
- Output
- "a"
Constraints
1 <= s.length <= 1000scontains only digits and English letters.