From 0a590f5d36a74683d0a7d82e49e9e03f550307c6 Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Tue, 6 Dec 2022 22:03:59 -0800 Subject: [PATCH] day 7 python slight improvement --- day07/sol.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/day07/sol.py b/day07/sol.py index e7e4253..e16698d 100644 --- a/day07/sol.py +++ b/day07/sol.py @@ -33,10 +33,6 @@ for cmd in cmds: print(sizes) -t = 0 -for sz in sizes.values(): - if sz <= 100000: - t += sz -print(t) +print(sum(sz for sz in sizes.values() if sz <= 100000)) print(min(sz for sz in sizes.values() if 70000000 - sizes[''] + sz >= 30000000))