프로그래머스 연습문제
- Lv 1. 부족한 금액 계산하기 (Python)
https://school.programmers.co.kr/learn/courses/30/lessons/82612
def solution(price, money, count):
answer = -1
sum = 0
for i in range(1, count + 1):
sum += price * i
if (money >= sum):
answer = 0
else:
answer = abs(money - sum)
return answer