Zero Positions
Return a list of the indexes where nums holds a 0, in increasing order. If there are no zeros, return an empty list. Hint: np.nonzero or np.where on a comparison.
Example 1
nums [4,0,3,0,0]
returns [1,3,4]
The zeros are at indexes 1, 3 and 4.
Constraints
1 <= len(nums) <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Best Columns of Each RowMedium
- Cells Above Row AverageMedium
- Count Local PeaksMedium
- Deepest Fall From a HighMedium
- Distance From a CellMedium
- Halfway PointMedium
- Highest Cell PositionMedium
- Matching PairsMedium