Advertisement
kosievdmerwe

Untitled

Dec 5th, 2021
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. class Solution:
  2.     def minCostToMoveChips(self, position: List[int]) -> int:
  3.         N = len(position)
  4.         num_odd = sum(p % 2 for p in position)
  5.         return min(
  6.             num_odd,
  7.             N - num_odd
  8.         )
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement