Description
Solutions
Longest Palindromic Substring
🔥 FULLTIME

Heads up! Original problem is from LeetCode 5. Note that in the original problem, a single character is also considered palindromic, so before printing, you just need to check if the length of the longest palindromic substring is 1. Otherwise, follow the original LeetCode problem as is.

Given a String s, return the longest palindromic substring in s.

Example 1:

Input:  s = "babad"
Output: "bab"
Explanation:
"aba" is also a valid answer.

Example 2:

Input:  s = "cbbd"
Output: "bb"
Explanation:
🦊🦊
Constraints:
  • 1 <= s.length <= 1000
  • s consist of only digits and English letters.
Thumbnail 0
Testcase

Result
Case 1

input:

output: