Problem
Ask
Submissions

Problem: Longest Palindromic Substring

Medium
30 min
Explore how to find the longest palindromic substring in a given string by understanding the problem constraints and applying an optimal solution. Learn to implement an algorithm that runs in O(n²) time and O(n²) space, and test your skills with hands-on coding challenges to strengthen your grasp of algorithm efficiency.

Statement

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

Note: If there are multiple valid palindromic substrings of the same length, return any of them.

Constraints

  • 11 \leq s.length 1000\leq 1000

  • s consist of only digits and English letters.

Problem
Ask
Submissions

Problem: Longest Palindromic Substring

Medium
30 min
Explore how to find the longest palindromic substring in a given string by understanding the problem constraints and applying an optimal solution. Learn to implement an algorithm that runs in O(n²) time and O(n²) space, and test your skills with hands-on coding challenges to strengthen your grasp of algorithm efficiency.

Statement

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

Note: If there are multiple valid palindromic substrings of the same length, return any of them.

Constraints

  • 11 \leq s.length 1000\leq 1000

  • s consist of only digits and English letters.