Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
It is always best to set x as the smallest non-zero element in nums.
Elements with the same value will always take the same number of operations to become 0. Contrarily, elements with different values will always take a different number of operations to become 0.
The answer is the number of unique non-zero numbers in nums.