문제) 기능개발
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
- 내 풀이
def solution(progresses, speeds):
day=[]
answer=[]
for p,s in zip(progresses, speeds):
remain=100-p
if remain%s!=0:
day.append(remain//s+1)
else:
day.append(remain//s)
for idx,d in enumerate(day):
if idx==0:
last=d
answer.append(1)
continue
if d<=last:
answer[-1]+=1
else:
answer.append(1)
last=d
return answer
- 다른 사람 풀이
- 올림 함수 .ceil() 사용하기
from math import ceil
'코딩테스트 > 프로그래머스' 카테고리의 다른 글
| [프로그래머스] [Level 2] [Heap] 더 맵게 (0) | 2022.07.26 |
|---|---|
| [프로그래머스] [Level 2] [스택/큐] 프린터 (0) | 2022.07.23 |
| [프로그래머스] [Level 2] [해시] 위장 (0) | 2022.07.21 |
| [프로그래머스][Level 2][해시] 전화번호 목록 (0) | 2022.07.18 |
| [프로그래머스] [Level 2] [2018 KAKAO BLIND RECRUITMENT 3차] 방금그곡 (0) | 2022.06.20 |