Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
short, simple and fast solution in Clear category for Nearest Value by Oksana_Antropova
def nearest_value(values: set, one: int) -> int:
return min((abs(n-one), n) for n in values)[1]
April 9, 2019
Comments: