Delete a File System Subtree with Limited APIs

Problem: Implement DeleteTree(path)

You are given a file system object fs. You may only use the following three immutable APIs:

fs.List(path)        # If path is a directory, return...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: