Clean up
This commit is contained in:
14
07/g.py
14
07/g.py
@@ -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]))
|
||||
|
||||
Reference in New Issue
Block a user