• + 0 comments
    def solve(coordinates):
        x = sorted([x for x,y in coordinates if x != 0])
        y = sorted([y for x,y in coordinates if y != 0])
        max_distance_x_values = max(x)-min(x)
        max_distance_y_values = max(y)-min(y)
        y0 = 0
        if abs(x[0])>abs(x[-1]):
            x0 = abs(x[0])
        else:
            x0 = abs(x[-1])
        if abs(y[0])>abs(x[-1]):
            y0 = abs(y[0])
        else:
            y0 = abs(y[-1])
        hyp = math.sqrt(x0**2+y0**2)
        possible_answers = [hyp, max_distance_x_values, max_distance_y_values]
        return float('{0:.12f}'.format(max(possible_answers)))