- Type: Array, math
- Approach:
- We can group the chips by checking whether its position index is odd or even, and count the number separately.
- Return the less number of groups, because we can have the same cost with the same parity.
- Complexity:
- Time: O(n)
- Space: O(1)