This commit is contained in:
mikas committed 2022-12-07 17:27:33 +02:00
1 parent d621db89ad
commit b5badd44bd
1 file changed
+5 -9
+5 -9
View File
@@ -80,22 +80,18 @@ for l in input:
tot = 0
for i in dirs.values():
dirsize = i.size()
if dirsize <= 100000:
tot += dirsize
print(tot)
usedspace = dirs['/'].size()
freespace = 70000000 - usedspace
candidates = []
for i in dirs.values():
dirsize = i.size()
if dirsize <= 100000:
tot += dirsize
if (freespace + dirsize) > 30000000:
candidates.append(dirsize)
print("Part 1: " + str(tot))
candidates.sort()
print(candidates[0])
print("Part 2: " + str(candidates[0]))