Learner Level

Implement the isArrayStrictlyIncreasing method that checks whether every array element is greater than the element before it.

The input contains an integer array nums and its length size. Your task is to check whether the array is strictly increasing.

An array is strictly increasing when every element is greater than the element before it. Equal values are not allowed. For example, [1,2,3,4] returns true, but [1,2,2,3] returns false.

Example 1
Input:
nums (int[]) = [1,2,3,4]
size (int) = 4
Return:
(boolean) true
Example 2
Input:
nums (int[]) = [1,2,2,3]
size (int) = 4
Return:
(boolean) false
Example 3
Input:
nums (int[]) = [5]
size (int) = 1
Return:
(boolean) true

Compare each element with the previous element.

If any current value is less than or equal to the previous value, the array is not strictly increasing and you can return false immediately. If the loop finishes, return true.

Pseudocode:

function isArrayStrictlyIncreasing(nums, size):
    for i from 1 to size - 1:
        if nums[i] <= nums[i - 1]:
            return false
    return true
Run your code to see the result.