LCP 06. 拿硬币

1
2
3
4
5
6
7
8
9
class Solution {
public int minCount(int[] coins) {
int count = 0;
for (int coin : coins) {
count += (coin + 1) / 2;
}
return count;
}
}

References

LCP 06. 拿硬币