[leetcode-5] Longest Palindrome Substring
ยท
๐Ÿข One step
LeetCode-5 Longest Palindrome Substring : ๊ฐ€์žฅ ๊ธด Palindrome note :Myanswerclass Solution: def longestPalindrome(self, s: str) -> str: if len(s)==1: return s[0] for i in range(0,len(s)-1): for j in range(0,i+1): org = s[j:len(s)-(-j+i)] if org[::-1]==org: return org return org[0] Result : 6515ms Memory: 13.9mbSolutionclass Solution: def longestPalindrome(self, s: str) -> str: def expend(left: int, ..
๋‹คํ–ˆ๋‹ค
'5' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก