FunctionRacerProblemsRace

Strictly Increasing Check

BeginnerSorting and searchingPython, JavaScript, TypeScript, Java, C++

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

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Sorting and searching problems