Skip to content

Commit 3250759

Browse files
refactor 588
1 parent 4896267 commit 3250759

File tree

1 file changed

+0
-35
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-35
lines changed

src/main/java/com/fishercoder/solutions/_588.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,6 @@
77
import java.util.List;
88
import java.util.Map;
99

10-
/**
11-
* 588. Design In-Memory File System
12-
*
13-
* Design an in-memory file system to simulate the following functions:
14-
15-
ls: Given a path in string format. If it is a file path, return a list that only contains this file's name.
16-
If it is a directory path, return the list of file and directory names in this directory.
17-
Your output (file and directory names together) should in lexicographic order.
18-
19-
mkdir: Given a directory path that does not exist,
20-
you should make a new directory according to the path.
21-
If the middle directories in the path don't exist either,
22-
you should create them as well. This function has void return type.
23-
24-
addContentToFile: Given a file path and file content in string format.
25-
If the file doesn't exist, you need to create that file containing given content.
26-
If the file already exists, you need to append given content to original content.
27-
This function has void return type.
28-
29-
readContentFromFile: Given a file path, return its content in string format.
30-
31-
Example:
32-
Input:
33-
["FileSystem","ls","mkdir","addContentToFile","ls","readContentFromFile"]
34-
[[],["/"],["/a/b/c"],["/a/b/c/d","hello"],["/"],["/a/b/c/d"]]
35-
Output:
36-
[null,[],null,null,["a"],"hello"]
37-
38-
Note:
39-
40-
You can assume all file or directory paths are absolute paths which begin with / and do not end with / except that the path is just "/".
41-
You can assume that all operations will be passed valid parameters and users will not attempt to retrieve file content or list a directory or file that does not exist.
42-
You can assume that all directory names and file names only contain lower-case letters, and same names won't exist in the same directory.
43-
44-
*/
4510
public class _588 {
4611
public static class Solution1 {
4712
/**

0 commit comments

Comments
 (0)