Add TQDM to 2024 day 9.
This commit is contained in:
parent
98eb515c19
commit
03e4e75978
@ -42,7 +42,7 @@ class Solver(BaseSolver):
|
||||
|
||||
contents = contents_0.copy()
|
||||
|
||||
for block_start, block_length in blocks[::-1]:
|
||||
for block_start, block_length in self.progress.wrap(blocks[::-1]):
|
||||
try:
|
||||
i_free = next(
|
||||
i_free
|
||||
@ -54,11 +54,10 @@ class Solver(BaseSolver):
|
||||
|
||||
free_start, free_length = frees[i_free]
|
||||
|
||||
for i in range(block_length):
|
||||
contents[free_start + i], contents[block_start + i] = (
|
||||
contents[block_start + i],
|
||||
None,
|
||||
)
|
||||
contents[free_start : free_start + block_length] = contents[
|
||||
block_start : block_start + block_length
|
||||
]
|
||||
contents[block_start : block_start + block_length] = [None] * block_length
|
||||
|
||||
if free_length == block_length:
|
||||
del frees[i_free]
|
||||
|
Loading…
Reference in New Issue
Block a user