An ant starts at a boundary at position nums.
At each step, the ant moves according to the value of nums[i]. If nums[i] > 0, the ant moves to the right by nums[i] units. If nums[i] < 0, the ant moves to the left by nums[i]
Return the total number of times the ant returns to the boundary.
Constraints:
nums.length
nums[i]
nums[i]
An ant starts at a boundary at position nums.
At each step, the ant moves according to the value of nums[i]. If nums[i] > 0, the ant moves to the right by nums[i] units. If nums[i] < 0, the ant moves to the left by nums[i]
Return the total number of times the ant returns to the boundary.
Constraints:
nums.length
nums[i]
nums[i]