Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Nearest Value by tokiojapan55
def nearest_value(values: set, one: int) -> int:
return sorted([(v,abs(v-one)) for v in list(values)], key=lambda a:(a[1], a[0]))[0][0]
June 22, 2020