File tree Expand file tree Collapse file tree
LeetCode/Medium/0005-longest-palindromic-substring Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <h2 ><a href =" https://leetcode.com/problems/longest-palindromic-substring " >5. Longest Palindromic Substring</a ></h2 ><h3 >Medium</h3 ><hr ><p >Given a string <code >s</code >, return <em >the longest</em > <span data-keyword =" palindromic-string " ><em >palindromic</em ></span > <span data-keyword =" substring-nonempty " ><em >substring</em ></span > in <code >s</code >.</p >
2+
3+ <p >  ; </p >
4+ <p ><strong class =" example " >Example 1:</strong ></p >
5+
6+ <pre >
7+ <strong >Input:</strong > s = " ; babad" ;
8+ <strong >Output:</strong > " ; bab" ;
9+ <strong >Explanation:</strong > " ; aba" ; is also a valid answer.
10+ </pre >
11+
12+ <p ><strong class =" example " >Example 2:</strong ></p >
13+
14+ <pre >
15+ <strong >Input:</strong > s = " ; cbbd" ;
16+ <strong >Output:</strong > " ; bb" ;
17+ </pre >
18+
19+ <p >  ; </p >
20+ <p ><strong >Constraints:</strong ></p >
21+
22+ <ul >
23+ <li><code>1 <= s.length <= 1000</code></li>
24+ <li><code>s</code> consist of only digits and English letters.</li>
25+ </ul >
You can’t perform that action at this time.
0 commit comments