The TransCompilator

Solved LeetCode program · 885 of 1,000

#1217 · Minimum Cost to Move Chips to The Same Position

Easy Array chunk-18.md

Original English source

The positions is a list of 1, 2, and 3. The evens is 0. The odds is 0.
For each value in positions.
If value modulo 2 is 0, add 1 to evens, otherwise add 1 to odds.

If evens is less than odds, show evens, otherwise show odds.

Open in Playground Browse all 1,000 problems

Expected stdout

1