i and j pointing to first and last element respectively
def rotate ( arr , n ) : NEW_LINE INDENT i = 0 NEW_LINE j = n - 1 NEW_LINE while i != j : NEW_LINE arr [ i ] , arr [ j ] = arr [ j ] , arr [ i ] NEW_LINE i = i + 1 NEW_LINE pass NEW_LINE DEDENT