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"
問題很清晰易理解,就是找到從左讀和從右讀是相同的子串(簡稱 迴文串)。
最近公司項目趕在發佈前期,好久都沒刷LeetCode了,偷點懶,直接上截圖: