Skip to content

Commit

Permalink
py imp
Browse files Browse the repository at this point in the history
  • Loading branch information
Azureki committed Oct 6, 2019
1 parent f05e94d commit 79c4bbd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 1217. Play with Chips/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from sys import maxsize


class Solution:
def minCostToMoveChips(self, chips: List[int]) -> int:
length = len(chips)
min_cost = maxsize
for i in range(length):
tem = 0
for j in range(length):
if (chips[j] - chips[i]) & 1 != 0:
tem += 1
if tem < min_cost:
min_cost = tem

return min_cost

0 comments on commit 79c4bbd

Please sign in to comment.