Add 2021 day 5.

This commit is contained in:
Mikael CAPELLE
2022-12-07 18:41:39 +01:00
parent 198927e4a3
commit 0d37458ec5
3 changed files with 559 additions and 0 deletions

View File

@@ -5,6 +5,13 @@ from pathlib import Path
lines = sys.stdin.read().splitlines()
# we are going to use Path to create path and go up/down in the file tree since it
# implements everything we need
#
# we can use .resolve() to get normalized path, although this will add C:\ to all paths
# on Windows but that is not an issue since only the sizes matter
#
# mapping from path to list of files or directories
trees: dict[Path, list[Path]] = {}