leetcode.jp 博客
本网站所有文字及图片内容均来自网络,每周定时更新,仅供个人学习与研究,请勿用于商业用途。谢谢合作。

5. Longest Palindromic Substring

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.

Example 1:

Input: "babad"
Output: "bab"
Note: "aba" is also a valid answer.

Example 2:

Input: "cbbd"
Output: "bb"

Difficulty:

Medium

Lock:

Normal

Company:

Adobe Airbnb Alibaba Amazon Apple Baidu Bloomberg Cisco eBay Facebook GoDaddy Google Huawei JPMorgan Mathworks Microsoft Oracle Pure Storage Roblox Samsung SAP ServiceNow Tencent Uber VMware Walmart Labs Wayfair Yahoo Yandex