{"id":"greedy-sort-descending-skip-every-third","text":"`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.","truth_value":"IN","source":"entries/2026/06/06/minimum-cost-of-buying-candies-with-discount-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"greedy-sort-descending-skip-every-third","truth_value":"IN","reason":"premise"}]}}