1 class Solution:
 2     def minCostToMoveChips(self, chips: List[int]) -> int:
 3         n = len(chips)
 4         odd,even = 0,0
 5         for i in range(n):
 6             cur = chips[i]
 7             if cur % 2 == 0:
 8                 even += 1
 9             else:
10                 odd += 1
11         return min(even,odd)

 

posted on 2019-10-06 13:44  Sempron2800+  阅读(181)  评论(0编辑  收藏  举报