3190. 使所有元素都可以被 3 整除的最少操作数
题目链接:3190. 使所有元素都可以被 3 整除的最少操作数
代码如下:
cpp
class Solution {
public:
int minimumOperations(vector<int>& nums) {
int operations = 0;
for (int num : nums) {
if (num % 3 != 0) {
operations++;
}
}
return operations;
}
};