
cost를 내림차 순 정렬function minimumCost(cost: number[]): number {
const sorted = cost.toSorted((a, b) => b - a)
const price = sorted.reduce((acc, cur, idx) => {
if((idx + 1) % 3 === 0) return acc
return acc + cur
}, 0)
return price
};