Given a nonempty array of int
s named nums
, determine if nums
is sorted in increasing order.
You should declare a boolean
variable named isIncreasing
and set it to true
if the
array is increasing, and false
otherwise.
For example: the arrays {1, 2, 3}
and {1, 2, 2, 3}
are both increasing but the array
{1, 3, 2}
is not.
Stuck? You may find these lessons helpful: