Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another Solution for leetcode java 1217 #182

Open
Aiyaret-Sandhu opened this issue Jan 23, 2024 · 0 comments
Open

Another Solution for leetcode java 1217 #182

Aiyaret-Sandhu opened this issue Jan 23, 2024 · 0 comments

Comments

@Aiyaret-Sandhu
Copy link

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant