르탄즈 5기
[르탄즈 5기] 1/26 TIL
박매트
2024. 1. 26. 22:57
코딩테스트 알고리즘 문제 풀이
문제 1
https://wnsgml517.tistory.com/72
[프로그래머스] 스택/큐 - 기능개발
나의 답 import math def solution(progresses, speeds): dic = [] for index, value in enumerate(progresses): a = math.ceil((100 - value)/speeds[index]) dic.append(a) result = [] max = dic[0] cnt = 0 for i in range (len(dic)-1): cnt+=1 if max
wnsgml517.tistory.com
문제 2
https://wnsgml517.tistory.com/71
[프로그래머스] 스택 - 같은 숫자는 싫어
나의 답 def solution(arr): answer = [] for i in range (len(arr)-1): if (arr[i]!=arr[i+1]): answer.append(arr[i]) answer.append(arr[len(arr)-1]) return answer 꽤나 금방 풀었다... 숫자가 달라지는 순간을 찾아 리스트에 append하였다
wnsgml517.tistory.com