Strings

Longest Palindromic Substring

medium
Given a string `s`, return the longest palindromic substring in `s`. If there are multiple answers of the same length, return any one of them. Example: `longestPalindrome("babad")` → `"bab"` or `"aba"`.
Hint steps(0/3 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.

  3. 3

    Complete previous step or reveal to unlock this hint.