Longest Palindromic Substring

Medium · Arrays & Strings · about 25 minutes

Asked at Amazon, Microsoft, Meta, Apple.

Given a string s, return its longest palindromic substring. The test cases are chosen so that the longest palindrome is unique.

Related guides