Design In-Memory File System
Design an in-memory file system to simulate ls, mkdir, addContentToFile, and readContentFromFile operations.
Design In-Memory File System

Design an in-memory file system to simulate ls, mkdir, addContentToFile, and readContentFromFile operations.

Example 1:
Input: {"operations":["FileSystem","ls","mkdir","addContentToFile","ls","readContentFromFile"],"args":[[],["/"],["/a/b/c"],["/a/b/c/d","hello"],["/"],["/a/b/c/d"]]}
Output: [null,[],null,null,["a"],"hello"]
Input
arr ={"operations":["FileSystem","ls","mkdir","addContentToFile","ls","readContentFromFile"],"args":[[],["/"],["/a/b/c"],["/a/b/c/d","hello"],["/"],["/a/b/c/d"]]}

Operations: [FileSystem, ls, mkdir, addContentToFile, ls, readContentFromFile]

Operations

FileSystem

ls

mkdir

addContentToFile

ls

readContentFromFile

File System Tree

📁

/

(empty)

Variables
No variables to display
DepthFunction Call
Stack empty
0/1