3476. Find Minimum Operations to Make All Elements Divisible by Three
My accepted C++ solution to LeetCode problem 3476, Find Minimum Operations to Make All Elements Divisible by Three, running in 0ms.
- Difficulty: Easy
- C++
- Runtime 0ms
- Memory 23.4MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
C++
Accepted on LeetCode — runtime 0ms, memory 23.4MB, accepted 2025-12-27.
class Solution {
public:
int minimumOperations(vector<int>& nums) {
int count = 0;
for (int n : nums) if (n % 3 != 0) count++;
return count;
}
};