Class Solution
java.lang.Object
g0001_0100.s0005_longest_palindromic_substring.Solution
5 - Longest Palindromic Substring.<p>Medium</p>
<p>Given a string <code>s</code>, return <em>the longest palindromic substring</em> in <code>s</code>.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> s = “babad”</p>
<p><strong>Output:</strong> “bab” <strong>Note:</strong> “aba” is also a valid answer.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> s = “cbbd”</p>
<p><strong>Output:</strong> “bb”</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> s = “a”</p>
<p><strong>Output:</strong> “a”</p>
<p><strong>Example 4:</strong></p>
<p><strong>Input:</strong> s = “ac”</p>
<p><strong>Output:</strong> “a”</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= s.length <= 1000</code></li>
<li><code>s</code> consist of only digits and English letters.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
longestPalindrome
-