distribute-candies-greedy-min

Status: IN

The answer to "distribute candies" is always `min(n//2, len(set(candyType)))` — the tighter of two independent upper bounds (eating quota vs. distinct types available), a constraint-as-min greedy pattern.

Source: entries/2026/06/06/distribute-candies-solution.md

JSON