본문 바로가기

부부의 코딩 성장 일기

검색하기
부부의 코딩 성장 일기
프로필사진 펩시_콜라

  • 분류 전체보기 (147)
    • Algorithm (135)
      • LeetCode (135)
    • Python (6)
      • Fundamentals (5)
      • Libraries (1)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/12   »
일 월 화 수 목 금 토
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 31
Tags
  • binary search
  • leetcode
  • two pointers
  • Python
  • 리트코드
  • 재귀
  • hash table
  • 미디움
  • 문자열
  • tree
  • dfs
  • string
  • Array
  • recursive
  • binary tree
  • Medium
  • DP
  • linked list
  • math
  • Binary
  • sorting
  • 쉬움
  • easy
  • backtracking
  • list
  • 중간
  • Depth-first Search
  • 이진트리
  • matrix
  • HashTable
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Leetcode5 (1)

부부의 코딩 성장 일기

LeetCode 5(Longest Palindormic Substring, Python)1

1. 문제 링크 https://leetcode.com/problems/longest-palindromic-substring/ str: result_len = 0 #대칭인 문자열의 길이 result ='' #대칭인 문자열 if len(s)= 0 and j < n and s[i] == s[j]: i, j = i - 1, j + 1 return s[i + 1:j] for k in range(n): ans = max(helper(k, k), helper(k, k + 1), ans, key=len) # helper(k, k) for odd length, helper(k, k+1) for even length return ans 5. 배운 점 확실히 난이도가 medium인 문제들은 단순히 이중 삼중 포문으로는 ti..

Algorithm/LeetCode 2023. 11. 27. 19:00
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바