I'm solving this problem. What is the longest increasing subarray (not subsequence. This means all elements in the subarray need to be contiguous in the array)

For example in array [1, 2, 3, 4, 5], [2, 3, 4] is a subarray but [1, 3, 4, 5] is not.

My brute force solution is below. I don't think it's O(n^2) bc each operation is taking O(j - i) time. What's the time complexity and can someone write a proof for it?

```
public int longestIncreasingSubarrayBruteForce(int[] array) {
int longestLength = 0;
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array.length; j++) {
longestLength = Math.max(getSubarrayLength(array, i, j), longestLength);
}
}
return longestLength;
}
private int getSubarrayLength(int[] array, int start, int end) {
int subarray = 1;
for (int i = start + 1; i <= end; i++) {
if (array[i] > array[i - 1]) {
subarray++;
}
else {
// Not subarray
return 0;
}
}
return subarray;
}
```