Smallest Positive
Return the smallest number in nums that is greater than 0. At least one number is positive.
Example 1
nums [-4,9,3,0,6]
returns 3
The positive numbers are 9, 3 and 6; the smallest is 3.
Constraints
1 <= len(nums) <= 100- At least one number is above 0
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Softmax WeightsEasy
- Sort Each RowEasy
- Strong RowsEasy
- Total Over LimitEasy
- Trend SlopeEasy
- Trimmed MeanEasy
- Vector DistanceEasy
- Weighted AverageEasy