Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
min(min) solution in Clear category for Nearest Value by katnic
def nearest_value(values: set, one: int) -> int:
V = sorted( list(values) )
Z = [abs(a - one) for a in V ]
return min( [i for i in V if Z[V.index(i)] == min(Z)] )
Aug. 12, 2021
Comments: