
# Process
# 1. Input progresses and speeds
# 2. Iterate while progresses is empty
# 2.1. Iterate all
# 2.1.1. Add all speed of work
# 2.2. Iterate from begin to the value less than 100 or the end
# 2.2.1. Check if it's over 99
# 2.2.1.1. If so -> pop, and count
# 2.2.1.2. If not -> end of iteration
# 2.3. Append count to answer
# 3. Return answer[]
def solution(progresses, speeds):
answer = []
while len(progresses) > 0:
count = 0
for i in range(0, len(progresses)):
progresses[i] += speeds[i]
isDone = False
j = 0
while (j < len(progresses) and not isDone):
if progresses[j] >= 100:
count += 1
progresses.pop(j)
speeds.pop(j)
j -= 1
else:
isDone = True
j += 1
if count > 0:
answer.append(count)
return answer
스택/큐 01 - 다리를지나는트럭, 프로그래머스, 알고리즘, Programmers, Stack, Queue, Hash, 코딩테스트, Al
# Process (list) # 1. Input prices list # 2. Iterate i from begin to the end # 2.1. Iterate j from i to the end # 2.1.1. Check if [j] is smaller than [i] # ..
itdar.tistory.com
아나콘다 환경 설치, 복사, 파이썬, Anaconda enviroment export/import, How to transfer conda environment, Python, 복
How to clone and make new conda enviroment on somewhere. 아나콘다의 파이썬 및 각종 개발환경 설치한 것을 동일 PC 혹은 다른 PC로 옮길 때 사용하는 커맨드라인 1. Check env name what you wanna export or..
itdar.tistory.com
LeetCode #0595 BigCountries. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제
LeetCode #0595 BigCountries. Algorithm,알고리즘,LeetCode,Codefights,CodeSignal,코드파이트,코드시그널,예제,문제해결능력,example,c++,java,재귀,recursive,datastructure,techinterview,coding,코딩인터..
itdar.tistory.com