To solve this problem, we need to find all of the directories with a total size of at most 100000. This can be done by traversing the directory tree and keeping track of the total size of each directory.
To implement this, we can use a dictionary to store the total size of each directory. As we traverse the tree, we can update the total size of each directory in the dictionary. When we encounter a file, we can add its size to the total size of the current directory. When we encounter a directory, we can move into it and repeat the process until we reach the end of the tree.
Once we have calculated the total size of each directory, we can simply iterate through the dictionary and sum the sizes of all the directories with a total size of at most 100000.
Here is some pseudocode that outlines the steps to solve this problem:
# create an empty dictionary to store the total size of each directory