find the maximum average subarray which length should be greater or equal to given length k. * Firstly, we know that the value of the average could lie between the range (min, max). * Here, min and ...
A subarray A[i], A[i+1], ..., A[j] of A is said to be turbulent if and only if: For i <= k < j, A[k] > A[k+1] when k is odd, and A[k] < A[k+1] when k is even; OR, for i <= k < j, A[k] > A[k+1] when k ...