Leetcode icon indicating copy to clipboard operation
Leetcode copied to clipboard

Another Solution for leetcode java 1217

Open Aiyaret-Sandhu opened this issue 1 year ago • 1 comments

class Solution { public int minCostToMoveChips(int[] position) { int even = 0; int odd = 0; for(int i : position) { if(i % 2 == 0) even++; else odd++; } return Math.min(even, odd); } }

This solution is much easier to understand. Actually i am learning and building my skills for open source so please assign me this issue to help me grow !

Aiyaret-Sandhu avatar Jan 23 '24 14:01 Aiyaret-Sandhu