Skip to content

Commit

Permalink
Merge pull request #2 from kjs254/1-kjs254
Browse files Browse the repository at this point in the history
1-kjs254
  • Loading branch information
kjs254 authored Feb 15, 2024
2 parents 765860f + f2cf6f5 commit 6f5effa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kjs254/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

| ์ฐจ์‹œ | ๋‚ ์งœ | ๋ฌธ์ œ์œ ํ˜• | ๋งํฌ | ํ’€์ด |
|:----:|:---------:|:----:|:-----:|:----:|
| 1์ฐจ์‹œ | 2023.10.27 | BFS | - | - |
---
| 1์ฐจ์‹œ | 2024.02.12 | ์Šคํƒ | [๊ธฐ๋Šฅ๊ฐœ๋ฐœ](https://school.programmers.co.kr/learn/courses/30/lessons/42586) | [#1](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/2) |
| 2์ฐจ์‹œ | 2024.02.15 | ํ | [ํ”„๋กœ์„ธ์Šค](https://school.programmers.co.kr/learn/courses/30/lessons/42587) | [#2](https://github.com/AlgoLeadMe/AlgoLeadMe-7/issues/6) |
---
25 changes: 25 additions & 0 deletions kjs254/์Šคํƒ/๊ธฐ๋Šฅ๊ฐœ๋ฐœ.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
def solution(progresses, speeds):
answer = []
days = []
stk = []

for i,p in enumerate(progresses):
term = 100-p
s = speeds[i]

if term%s==0:
days.append(term//s)
else:
days.append(term//s+1)

while days:
if not stk:
stk.append(days.pop(0))
elif max(stk)>=days[0]:
stk.append(days.pop(0))
else:
answer.append(len(stk))
stk.clear()

answer.append(len(stk))
return answer

0 comments on commit 6f5effa

Please sign in to comment.