Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- python 릿코드
- binary search
- leetcode 풀기
- 파이썬 알고리즘 풀기
- python priority queue
- 잇츠디모
- python Leetcode
- 릿코드 파이썬
- 파이썬 릿코드
- python 알고리즘
- 릿코드풀기
- 파이썬알고리즘풀기
- python xor
- 릿코드풀이
- 릿코드
- leetcode풀이
- 파이썬알고리즘
- 알고리즘풀이
- 파이썬 프로그래머스
- 파이썬릿코드풀기
- 릿코드 풀기
- 파이썬 알고리즘
- python sorted
- python zip_longest
- leetcode풀기
- 상가수익률계산기
- 코틀린기초
- LeetCode
- 알고리즘풀기
- 파이썬릿코드
Archives
- Today
- Total
목록leetcode palindrome (1)
소프트웨어에 대한 모든 것

5. Longest Palindromic Substring https://leetcode.com/problems/longest-palindromic-substring/ 문제) 솔루션1) middle 문자를 정하고 왼쪽, 오른쪽 포인터를 정해서 비교해서 동일한 문자면 한 칸씩 이동하면서 회문임을 확인한다. 시간 복잡도 : O(n*n) class Solution: def longestPalindrome(self, s: str) -> str: def get_palindrome(left, right): # 왼쪽, 오른쪽으로 이동하면서 회문을 탐색 while left >= 0 and right < len(s) and s[left] == s[right]: left -= 1 right += 1 return s[lef..
알고리즘/LeetCode
2022. 5. 24. 07:22