공부/코딩테스트
[프로그래머스] 부족한 금액 계산하기(파이썬)
ghhong
2021. 12. 10. 12:49
내 답
def solution(price, money, count):
answer = (count*(count+1)/2)*price-money
if answer<=0:
return 0
else: return answer
다른 사람의 답
def solution(price, money, count):
return max(0,price*(count+1)*count//2-money)