Solution to problem 9 in Python
This commit is contained in:
@@ -148,7 +148,9 @@ def part_2() -> None:
|
|||||||
continue
|
continue
|
||||||
res.append(bassin([pos], {pos}))
|
res.append(bassin([pos], {pos}))
|
||||||
|
|
||||||
print(prod(sorted(res)[-3:]))
|
largest_basin = prod(sorted(res)[-3:])
|
||||||
|
|
||||||
|
print(f"The product of the three largest basins is {largest_basin}")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user