function solution(price, money, count) {
let answer = 0;
for(let i = 1; i <= count; i++) answer = answer + price * i;
//answer += answer price * i
return answer > money ? answer - money : 0;
}
function solution(price, money, count) {
const tmp = price * count * (count + 1) / 2 - money;
return tmp > 0 ? tmp : 0;
}