Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
ℤ ≅ ℕ × bool solution in Clear category for Nearest Value by veky
def nearest_value(values: set, one: int) -> int:
def distance(value): return abs(value - one), value > one
return min(values, key=distance)
March 18, 2019
Comments: