Print Directory Tree Given a File Path

Asked at Adobe · Coding Questions · Difficulty: Medium

Given a filesystem and a `path` (possibly a directory), print all files and folders under that path as a tree. (The original problem walks a real filesystem in Node.js; here the filesystem is provided as a nested dict — a directory maps a name to its subtree, a file maps to `None` — rooted at `/`.)

Loading the problem…