File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
0005-longest-palindromic-substring Expand file tree Collapse file tree 1 file changed +24
-0
lines changed 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 ><div ><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 ><strong >Input:</strong > s = "babad"
7+ <strong >Output:</strong > "bab"
8+ <strong >Explanation:</strong > "aba" is also a valid answer.
9+ </pre >
10+
11+ <p ><strong class =" example " >Example 2:</strong ></p >
12+
13+ <pre ><strong >Input:</strong > s = "cbbd"
14+ <strong >Output:</strong > "bb"
15+ </pre >
16+
17+ <p >  ; </p >
18+ <p ><strong >Constraints:</strong ></p >
19+
20+ <ul >
21+ <li><code>1 <= s.length <= 1000</code></li>
22+ <li><code>s</code> consist of only digits and English letters.</li>
23+ </ul >
24+ </div >
You can’t perform that action at this time.
0 commit comments