https://school.programmers.co.kr/learn/courses/30/lessons/120837
def solution(hp):
power = [5, 3, 1]
count = 0
for p in power:
if hp >= p:
c, d = divmod(hp, p)
count += c
hp = d
return count
728x90
반응형
'🔻PS > Programmers' 카테고리의 다른 글
[Programmers] 프로그래머스 부족한 금액 계산하기 Python (0) | 2024.05.06 |
---|---|
[Programmers] 프로그래머스 성격 유형 검사하기 Python (0) | 2024.05.05 |
[Programmers] 프로그래머스 k번째수 Python (0) | 2024.05.04 |
[Programmers] 프로그래머스 가장 먼 노드 Python (0) | 2024.05.03 |
[Programmers] 프로그래머스 삼총사 Python (0) | 2024.03.22 |