package leetcode;

/**
 * https://leetcode.com/problems/play-with-chips/
 */
public class Problem1217 {
    public int minCostToMoveChips(int[] chips) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1217 prob = new Problem1217();
        System.out.println(prob.minCostToMoveChips(new int[]{1,2,3})); // 1
        System.out.println(prob.minCostToMoveChips(new int[]{2,2,2,3,3})); // 2
        System.out.println(prob.minCostToMoveChips(new int[]{1,1,2,3,3})); // 1
    }
}

@@ -158,38 +158,47 @@
     
-// TODO%0A        return
+int even = 0;%0A        int odd =
  0;%0A    
 %7D%0A%0A 
@@ -197,100 +197,112 @@
     
-%7D%0A%0A
     
-public static void main(String%5B%5D args) %7B%0A        Problem1217 prob = new Problem1217()
+for (int i = 0; i %3C chips.length; i++) %7B%0A            if (chips%5Bi%5D %25 2 == 0) %7B%0A                even++
 ;%0A  
@@ -311,235 +311,103 @@
     
+ 
-System.out.println(prob.minCostToMoveChips(new int%5B%5D%7B1,2,3%7D)); // 1%0A        System.out.println(prob.minCostToMoveChips(new int%5B%5D%7B2,2,2,3,3%7D)); // 2%0A        System.out.println(prob.minCostToMoveChips(new int%5B%5D%7B1,1,2,3,3%7D)); // 1
+   %7D else %7B%0A                odd++;%0A            %7D%0A        %7D%0A        return Math.min(even, odd);
 %0A   

Solve problem 1217