diff options
-rw-r--r-- | 2021/07/puzzles.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/2021/07/puzzles.py b/2021/07/puzzles.py index b0ccb32..bfd9bb3 100644 --- a/2021/07/puzzles.py +++ b/2021/07/puzzles.py @@ -15,7 +15,12 @@ def main() -> None: with open("input", "r", encoding="utf-8") as f: data = list(map(int, f.read().split(","))) - print(min(sum(gauss_sum(abs(i - data[j])) for j in range(len(data))) for i in range(max(data)))) + print( + min( + sum(gauss_sum(abs(i - data[j])) for j in range(len(data))) + for i in range(min(data), max(data) + 1) + ) + ) if __name__ == "__main__": |