1217. Minimum Cost to Move Chips to The Same Position Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 1217class Solution: def minCostToMoveChips(self, position: List[int]) -> int: a = sum(p % 2 for p in position) b = len(position) - a return min(a, b)