Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def minCostToMoveChips(self, position: List[int]) -> int:
- N = len(position)
- num_odd = sum(p % 2 for p in position)
- return min(
- num_odd,
- N - num_odd
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement