greedy-sort-descending-skip-every-third

Status: IN

`minimumCost` sorts candy prices descending and sums elements where `i % 3 != 2`, skipping every third element as the free candy — the canonical greedy for "buy 2 get 1 free" minimization.

Source: entries/2026/06/06/minimum-cost-of-buying-candies-with-discount-solution.md

JSON