其他分享
首页 > 其他分享> > leetcode1217

leetcode1217

作者:互联网

 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)

 

标签:even,10,cur,int,chips,leetcode1217,odd
来源: https://www.cnblogs.com/asenyang/p/11627129.html