Function to reverse the subarray arr [ 0. . . i ]
def getUpdatedArray ( arr , copy , i ) : NEW_LINE INDENT for j in range ( ( i // 2 ) + 1 ) : NEW_LINE INDENT copy [ j ] = arr [ i - j ] NEW_LINE copy [ i - j ] = arr [ j ] NEW_LINE DEDENT return NEW_LINE DEDENT