알고리즘
2024. 1. 3.
[프로그래머스/PCCP_1번] 붕대 감기(파이썬)
문제 설명 이 문제는 게임을 하다 보면 치료를 통해 게임 캐릭터의 피를 회복하는 경우를 문제로 하고 있다. def solution(bandage, health, attacks): answer = health healing = 0 t = 0 max_time = attacks[-1][0] at = {} for i in range(len(attacks)): at[attacks[i][0]] = attacks[i][1] while t health: answer = health healing = 0 t += 1 return answer 문제 링크: https://school.programmers.co.kr/learn/courses/30/lessons/250137