Operations to Zero the Array
Asked at Amazon · Coding Questions · Difficulty: Easy
In one operation you pick a positive `x` no larger than the smallest non-zero element, then subtract `x` from every positive element. Return the minimum number of operations to make every element `0`.
Loading the problem…