30:00
Design an in-memory file system to simulate ls, mkdir, addContentToFile, and readContentFromFile operations.
1≤path.length,filePath.length≤100
Path is a valid absolute path (starts with / and does not end with /, except for the root).
Directory and file names contain only lowercase English letters and digits.
At most 300 calls in total to the four functions.
Operations: [FileSystem, ls, mkdir, addContentToFile, ls, readContentFromFile]
Operations
FileSystem
ls
mkdir
addContentToFile
ls
readContentFromFile
File System Tree
📁
/
(empty)