Loop through the array with a starting point as i for the required subarray till the longest subarray is found
for i in range ( N ) : NEW_LINE INDENT start = i ; NEW_LINE end = N - 1 ; NEW_LINE max_index = i ; NEW_LINE DEDENT