aoc2021/d07/d07_1.py

3 lines
129 B
Python

L=list(map(int,__import__("sys").stdin.read().split(",")))
print(min(sum(abs(l-i) for l in L) for i in range(min(L), max(L)+1)))