package com.fishercoder.solutions;

public class _1217 {
    public static class Solution1 {
        /**
         * credit: https://leetcode.com/problems/play-with-chips/discuss/398239/C%2B%2B-3-lines
         */
        public int minCostToMoveChips(int[] chips) {
            int chipsAtOddPosition = 0;
            int chipsAtEvenPosition = 0;
            for (int i = 0; i < chips.length; i++) {
                if (chips[i] % 2 == 0) {
                    chipsAtEvenPosition++;
                } else {
                    chipsAtOddPosition++;
                }
            }
            return chipsAtEvenPosition > chipsAtOddPosition ? chipsAtOddPosition : chipsAtEvenPosition;
        }
    }
}

@@ -250,21 +250,24 @@
 s(int%5B%5D 
-chips
+position
 ) %7B%0A    
@@ -375,21 +375,24 @@
  0; i %3C 
-chips
+position
 .length;
@@ -419,21 +419,24 @@
     if (
-chips
+position
 %5Bi%5D %25 2 

refactor 1217