연속된 부분 수열의 합 - Python, 부분합, 슬라이딩 윈도우
https://school.programmers.co.kr/learn/courses/30/lessons/178870 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 & 풀이 def solution(sequence, k): answer = [] L, R, total, minCnt = 0, 0, 0, len(sequence) while R k and L R - L: minCnt = R - L answer = [L, R] R += 1 return answer 매번 합을 구하면 비효율적이겠죠 그렇기 때..
2024. 12. 16.
2023 KAKAO BLIND RECRUITMENT > 택배 배달과 수거하기 - Pyton, 구현
https://school.programmers.co.kr/learn/courses/30/lessons/150369 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 & 풀이 def solution(cap, n, deliveries, pickups): answer = 0 delivery_idx, pickup_idx = n - 1, n - 1 def check_endpoint(idx, task): while idx >= 0 and task[idx] == 0: idx -= 1 return idx def move(idx, ta..
2024. 12. 9.