Ustory

  • 홈
  • 방명록

string 1

[99클럽 코테 스터디 30일차 TIL] LeetCode | 1529. Minimum Suffix Flips

Problemhttps://leetcode.com/problems/minimum-suffix-flips/ Sol초기 '0'으로만 이루어진 문자열 s의 특정 인덱스 i부터 n-1까지 flip 했을때 '0'과 '1'로 이루어진 target과 똑같아 질 수 있는 최소 flip 수를 세는 문제 해결 방법👀 처음에 단순하게 생각해서 그냥 반복문으로 풀었습니다. for문이 안팎으로 돌다보니까 최소의 수를 보장할 수도 없고 시간복잡도가 O(n^2)이 나오는 효율 바닥 코드가 나왔습니다. 혹시나 했는데 역시나 test case는 통과했지만 submit을 하니까 Time Limit Exceeded가 떴습니다. T.T  class Solution: def minFlips(self, target: str) -> in..

TIL/Algorithm 2024.06.18
이전
1
다음
더보기
프로필사진

Ustory

에러일기

  • Ustory (37)
    • TIL (28)
      • Algorithm (24)
      • 영상처리 : OpenCV (1)
      • 정처기 (2)
      • 빅분기 (0)
      • 경제금융 (1)
    • DarkCircle (7)
      • Kotlin (6)

Tag

array, Python, DP, 개발자 취업, Two-Pointer, graph, 프로그래머스, DFS, til, LeetCode, combinations, greedy, 항해99, BFS, BinarySearch, DynamicProgramming, Programmers, 코딩테스트 준비, 99클럽, combination,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바