본문 바로가기 메뉴 바로가기

허서기의 블로그

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

허서기의 블로그

검색하기 폼
  • 분류 전체보기 (36)
    • 독서 (0)
    • 개발 (34)
      • 알고리즘 (24)
      • 프로젝트 (4)
      • 공부 (3)
  • 방명록

palindrome partitioning 2 (1)
[leetcode 매일 풀기] 132. palindrome partitioning 2

오늘 리뷰할 문제는 palindrome partitioning 2이다. https://leetcode.com/problems/palindrome-partitioning-ii/ int: def is_palindrome(string: str) -> bool: return string == string[::-1] cache = {} def solve_min_cut(i: int, j: int) -> int: key = (i, j) if key in cache: return cache[key] if is_palindrome(s[i:j]): cache[key] = 0 return 0 min_cut = j - i + 1 for index in range(i + 1, j): if is_palindrome(s[i:ind..

개발/알고리즘 2023. 12. 19. 22:54
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • slay the spire에 진심인편
  • leetcode
  • scramble string
  • otel
  • 회고
  • Python
  • substring with concatenation of all words
  • datalakehouse
  • valid number
  • n queens 2
  • 개발자 글쓰기
  • mlse
  • hard mode challenge
  • distinct subsequences
  • maximum rectangle
  • leetcode 매일 풀기
  • first missing positive
  • word ladder 2
  • text justification
  • 가상면접 사례로 배우는 대규모 시스템 설계
  • 글또 10기
  • best time to buy and sell stock 3
  • longest valid parentheses
  • binary tree maximum path sum
  • sudoku solver
  • permutation sequence
  • 알고리즘
  • leetcode 매일풀기
  • palindrome partitioning 2
  • wildcard matching
more
«   2025/09   »
일 월 화 수 목 금 토
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 29 30
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.