Simply find the closest value to zero from the list. Notice that there are negatives in the list.

List is always not empty and contains only integers. Return ```None``` if it is not possible to define only one of such values. And of course, we are expecting 0 as closest value to zero.

Examples:
```code
[2, 4, -1, -3]  => -1
[5, 2, -2]      => None
[5, 2, 2]       => 2
[13, 0, -6]     => 0
```

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Data structures

Starter code: def closest(lst):
	

Solutions:
def closest(lst):
	m = min(lst, key=abs)
	return m if m == 0 or -m not in lst else None


def closest(lst):
	result = min(lst, key=abs)
	return result if not result or -result not in lst else None


def closest(lst):
	m = min(lst, key=lambda x: abs(x))
	if not m or -m not in lst:
		return m


def closest(lst):
	lst = sorted(set(lst), key=abs)
	if len(lst) > 1 and abs(lst[0]) == abs(lst[1]):
		return None
	return lst[0]


def closest(lst):
	min_v = min(lst, key=lambda x: abs(x))
	return None if -min_v in lst and min_v else min_v


from functools import reduce
closest = lambda arr: (lambda r: None if r[1] else r[0])(reduce(lambda a, b: [a[0], True] if a[0] and a[0] == -b else [b, False] if abs(b) < abs(a[0]) else a, arr, [999999, False]))


def closest(lst):
	m = min((abs(x) for x in lst))
	res = set((v for v in lst if abs(v) == m))
	return list(res)[0] if len(res) == 1 else None


def closest(lst):
	m = min(lst, key=lambda x: abs(0 - x))
	return m if [abs(v) for v in set(lst)].count(abs(m)) == 1 else None


def closest(lst):
	return min(lst, key=lambda x: abs(x)) if -min(lst, key=lambda x: abs(x)) not in lst or min(lst, key=lambda x: abs(x)) == 0 else None