File tree 1 file changed +36
-0
lines changed
longest-palindromic-substring
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ <h2 >5. Longest Palindromic Substring</h2 ><h3 >Medium</h3 ><hr ><div ><p >Given a string <code >s</code >, return  ; <em >the longest palindromic substring</em > in <code >s</code >.</p >
2
+
3
+ <p >  ; </p >
4
+ <p ><strong >Example 1:</strong ></p >
5
+
6
+ <pre ><strong >Input:</strong > s = "babad"
7
+ <strong >Output:</strong > "bab"
8
+ <strong >Note:</strong > "aba" is also a valid answer.
9
+ </pre >
10
+
11
+ <p ><strong >Example 2:</strong ></p >
12
+
13
+ <pre ><strong >Input:</strong > s = "cbbd"
14
+ <strong >Output:</strong > "bb"
15
+ </pre >
16
+
17
+ <p ><strong >Example 3:</strong ></p >
18
+
19
+ <pre ><strong >Input:</strong > s = "a"
20
+ <strong >Output:</strong > "a"
21
+ </pre >
22
+
23
+ <p ><strong >Example 4:</strong ></p >
24
+
25
+ <pre ><strong >Input:</strong > s = "ac"
26
+ <strong >Output:</strong > "a"
27
+ </pre >
28
+
29
+ <p >  ; </p >
30
+ <p ><strong >Constraints:</strong ></p >
31
+
32
+ <ul >
33
+ <li><code>1 <= s.length <= 1000</code></li>
34
+ <li><code>s</code> consist of only digits and English letters (lower-case and/or upper-case),</li>
35
+ </ul >
36
+ </div >
You can’t perform that action at this time.
0 commit comments