Search
⌘K

Leetcode 1217. Minimum Cost to Move Chips to The Same Position

Chips can move by ±2 for free but ±1 costs 1, so the problem asks for the minimum cost to gather all chips at one position given parity-based moves. The optimal cost equals the smaller of the counts of chips on even vs odd positions (move the minority parity chips one step each).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.