Implemented O(n) complexity function for maximize(j-i) where array[j] > array[i]