We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12a871a commit 9fa364aCopy full SHA for 9fa364a
longest-palindromic-substring/index.ts
@@ -7,7 +7,7 @@ export default function longestPalindrome(s: string): string {
7
const str1 = expand(s, i, i);
8
const str2 = expand(s, i, i + 1);
9
ans = [str1, str2].reduce((p, v) => (p.length > v.length ? p : v), ans);
10
-
+if(ans===s)return s
11
i = i + 1;
12
}
13
return ans;
0 commit comments