list_objects_v2 returns objects as {"Key": ..., "Size": ...}. Sum sizes by the first depth path
segments of the key (segments are separated by /). An object with fewer segments is grouped by its
folder (all segments but the file name); objects at the bucket root are grouped under "".
Prefixes in the output end with / (except the root "").
Implement prefix_sizes. Input: objects: list[dict], depth: int. Returns: dict[str, int].
def prefix_sizes(objects: list[dict], depth: int) -> dict[str, int]:
return {}
Run executes the public tests. Submit grades against public and hidden tests.
list_objects_v2 returns objects as {"Key": ..., "Size": ...}. Sum sizes by the first depth path
segments of the key (segments are separated by /). An object with fewer segments is grouped by its
folder (all segments but the file name); objects at the bucket root are grouped under "".
Prefixes in the output end with / (except the root "").
Implement prefix_sizes. Input: objects: list[dict], depth: int. Returns: dict[str, int].
def prefix_sizes(objects: list[dict], depth: int) -> dict[str, int]:
return {}
Run executes the public tests. Submit grades against public and hidden tests.