코딩테스트/프로그래머스7 [프로그래머스] LV2 더 맵게 | 파이썬 링크 : https://medium.com/@k62570/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-lv2-%EB%8D%94-%EB%A7%B5%EA%B2%8C-%ED%8C%8C%EC%9D%B4%EC%8D%AC-42f613a67a62 [프로그래머스] LV2 더 맵게 | 파이썬After Age 40, You Need to Stop Doing These Morning Habits — That Speed Up Aging Your Morning Routine Making You Age Faster?medium.com 2025. 5. 7. [프로그래머스] LV1 데이터분석 | 파이썬 Solution :def solution(data, ext, val_ext, sort_by): if ext =='code': ext=0 elif ext == 'date': ext=1 elif ext == 'maximum': ext=2 elif ext == 'remain': ext=3 # val_ext 를 기준으로 추출하고 new=[] for i in range(len(data)): if val_ext > data[i][ext]: # val_ext보다 작은거만 추가함. new.append(data[i]) # print(new) # s.. 2025. 5. 7. [프로그래머스] LV2 주식가격 | 파이썬 Solution :## 시간복잡도 최악의 경우 O(N^2)from collections import dequedef solution(prices): # 초기화 q_prices=deque(prices) answer=[] while q_prices: count=0 temp_value=q_prices.popleft() # 값이 나오고. for i in q_prices: count+=1 if temp_value >i : break answer.append(count) return answer## 시간복잡도 더 빠름.def solution(prices): s.. 2025. 5. 7. [프로그래머스] LV2 기능개발 | 파이썬 Solution :import mathfrom collections import dequedef solution(progresses, speeds): # [1] 남은 일 수 구하기 days=[math.ceil((100-i)/k) for i,k in zip(progresses,speeds)] # print(days) # 초기화 answer = [] q_days=deque(days) current_day=q_days.popleft() count=1 # [2] while 반복문 돌림 + 누적O 및 누적X while q_days: if q_days and current_day >= q_days[0]: # 누적.. 2025. 5. 7. [프로그래머스] LV2 프로세스 | 파이썬 링크 : https://medium.com/@k62570/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-lv2-%ED%94%84%EB%A1%9C%EC%84%B8%EC%8A%A4-%ED%8C%8C%EC%9D%B4%EC%8D%AC-3c63a01a4a9e [프로그래머스] LV2 프로세스 | 파이썬“[프로그래머스] LV2 프로세스 | 파이썬” is published by Taein Yong.medium.com 2025. 5. 7. [프로그래머스] LV2 다리를 지나는 트럭 | 파이썬 Solution :1. Stack 풀이 :## 스택def solution(bridge_length, weight, truck_weights): # 초기화 time = 0 bridge=[0]*bridge_length # 다리 weight_sum=0 # 트럭이 빌 때까지 반복문 돌림. while truck_weights: weight_sum=weight_sum-bridge.pop(0) time+=1 if weight_sum + truck_weights[0] 2. queue 풀이 :## 큐from collections import dequedef solution(bridge_length, weight, truck_weights).. 2025. 5. 7. 이전 1 2 다음