The main function that finds the smallest distance . This method mainly uses closestUtil ( )
def closest ( P , n ) : NEW_LINE INDENT P . sort ( key = lambda point : point . x ) NEW_LINE Q = copy . deepcopy ( P ) NEW_LINE Q . sort ( key = lambda point : point . y ) NEW_LINE DEDENT