Function to right rotate
def right_rotate ( arr ) : NEW_LINE INDENT start = arr [ len ( arr ) - 2 ] NEW_LINE for i in range ( len ( arr ) - 4 , - 1 , - 2 ) : NEW_LINE INDENT arr [ i + 2 ] = arr [ i ] NEW_LINE DEDENT arr [ 0 ] = start NEW_LINE DEDENT