М
Size: a a a
М
mБ
mБ
mБ
mБ
mБ
mБ
mБ
mБ
mБ
mБ
GA
VF
VF
O
getTicketsCount(coins, price) {
const minCoin = Math.min.apply(
null, coins);
const sum = coins.reduce((p, n) => p + n, 0);
const max = Math.floor(sum / price);
const min = Math.floor((sum - minCoin) / price) + (( sum % price) > 0 ? 0: 1);
return { min, max };
}
М
GA