class Solution {
public:
int minimumOperations(vector<int>& nums) {
unordered_set<int> seen(begin(nums), end(nums));
return seen.size() - seen.count(0);
}
};
leetcode
challenge
Here is the link for the problem:
https://leetcode.com/problems/make-array-zero-by-subtracting-equal-amounts/
Top comments (0)