Thanks to visit codestin.com Credit goes to github.com
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 d19b107 commit aa2c4e6Copy full SHA for aa2c4e6
2-python/ch06/6-1.py
@@ -2,10 +2,10 @@ class Solution:
2
def longestPalindrome(self, s: str) -> str:
3
# 팰린드롬 판별 및 투 포인터 확장
4
def expand(left: int, right: int) -> str:
5
- while left >= 0 and right <= len(s) and s[left] == s[right - 1]:
+ while left >= 0 and right < len(s) and s[left] == s[right]:
6
left -= 1
7
right += 1
8
- return s[left + 1:right - 1]
+ return s[left + 1:right]
9
10
# 해당 사항이 없을때 빠르게 리턴
11
if len(s) < 2 or s == s[::-1]:
0 commit comments