[프로그래머스] 부족한 금액 계산하기Lv.1

나의 풀이

def solution(price, money, count):
    for i in range(1, count + 1):
        money -= (price * i)
    return abs(money) if money < 0 else 0

0개의 댓글

Powered by GraphCDN, the GraphQL CDN