Strictly Increasing Check
Return True if nums is sorted in strictly increasing order, meaning every item is bigger than the item just before it. Equal neighbours do not count as increasing, so [1, 2, 2] gives False.
An empty list and a list with one item both count as strictly increasing.
Example 1
nums [1,3,4,9]
returns true
Each item is bigger than the one before it.
Example 2
nums [1,2,2,5]
returns false
The two 2s are equal neighbours, so the list is not strictly increasing.
Constraints
0 <= len(nums) <= 100-1000 <= nums[i] <= 1000
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Sorting and searching problems
- Top Three ValuesBeginner
- Where It LandsBeginner
- Widest Gap After SortingBeginner
- Binary SearchEasy
- Can Attend All MeetingsEasy
- Can Make Arithmetic ProgressionEasy
- Count Between in a Sorted ListEasy
- Custom Sort StringEasy