Daily challenge for 2026-09-06
614. Minimum Badge Adjustment Cost
You are given an integer array badges. At most one distinct badge value occurs exactly once; every other distinct value occurs an even number of times. You may increment or decrement the single badge by 1 at a cost of 1 coin per step. Return the minimum cost to change it to a different value already present in the array. If there is no single badge or no different value to match, return 0.
Example:
Input: badges = [4,4,10,10,7]
Output: 3
Explanation: Changing the single badge 7 to either 4 or 10 costs 3 coins. Only the single badge is changed; the task does not require all final frequencies to be even.
Run this challenge interactively in Python or JavaScript when the app loads.