Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
min with key solution in Clear category for Nearest Value by saklar13
def nearest_value(values: set, one: int) -> int:
return min(values, key=lambda v: (abs(v - one), v))
Oct. 12, 2020
Comments: