Write code to compute the size of all folders in a directory.
Asked in the Round 1 stage. It is unclear whether the interviewer wanted low-level design or problem solving.
Represent a directory as a nested dictionary. Integer values are file sizes in bytes, and dictionaries are subfolders. Implement folder_sizes(directory) to return a dictionary mapping each folder's absolute path to its total size, including all descendant files. Include the root folder at /.
/.def folder_sizes(directory):