Um momento
Leetcode / 3190. Find Minimum Operations To Make All Elements Divisible By Three

Pick a programming language:

Here is the source code for the solution to this problem.

class Solution {
    public int minimumOperations(int[] nums) {
        int count = 0;

        for (int i = 0; i < nums.length; i++) {
            if (nums[i] % 3 != 0) {
                count++;
            }
        }

        return count;
    }
}
Gostou da aula? 😆👍
Apoie nosso trabalho com uma doação: