题目 题解 所有的 chips,要么在奇数位置,要么在偶数位置 class Solution { public int minCostToMoveChips(int[] position) { int p0 = 0; int p1 = 0; for (int n : position) { if (n % 2 == 0) p0 += 1; else p1 += 1; } return Math.min(p0, p1); } }