You have a list of [path, size_bytes] pairs for files, with absolute POSIX paths such as
/var/log/syslog. Sum the sizes per top-level directory (/var, /home, ...). Files directly in /
count under /.
Implement usage_by_top_dir. Input: files: list[[str, int]]. Returns: dict[str, int].
def usage_by_top_dir(files: list[list]) -> dict[str, int]:
pass
Run executes the public tests. Submit grades against public and hidden tests.
You have a list of [path, size_bytes] pairs for files, with absolute POSIX paths such as
/var/log/syslog. Sum the sizes per top-level directory (/var, /home, ...). Files directly in /
count under /.
Implement usage_by_top_dir. Input: files: list[[str, int]]. Returns: dict[str, int].
def usage_by_top_dir(files: list[list]) -> dict[str, int]:
pass
Run executes the public tests. Submit grades against public and hidden tests.