Shouldn’t it be j<=e ( in line 9) since we are already giving e the index of last element of the array (line 48) ?