We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ad95d1 commit c25b0fbCopy full SHA for c25b0fb
src/main/java/com/fishercoder/solutions/_1217.java
@@ -5,11 +5,11 @@ public static class Solution1 {
5
/**
6
* credit: https://leetcode.com/problems/play-with-chips/discuss/398239/C%2B%2B-3-lines
7
*/
8
- public int minCostToMoveChips(int[] chips) {
+ public int minCostToMoveChips(int[] position) {
9
int chipsAtOddPosition = 0;
10
int chipsAtEvenPosition = 0;
11
- for (int i = 0; i < chips.length; i++) {
12
- if (chips[i] % 2 == 0) {
+ for (int i = 0; i < position.length; i++) {
+ if (position[i] % 2 == 0) {
13
chipsAtEvenPosition++;
14
} else {
15
chipsAtOddPosition++;
0 commit comments