Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
The only way to change <code>nums[0]</code> to 1 is by performing an operation with index <code>i = 0</code>.
Iterate from left to right and perform an operation at each index i where nums[i] is 0, and keep track of how many operations are currently performed on the suffix.