Skip to content

Commit 8e35228

Browse files
committed
Create README - LeetHub
1 parent 970f50a commit 8e35228

File tree

1 file changed

+42
-0
lines changed
  • 1233-remove-sub-folders-from-the-filesystem

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<h2><a href="https://leetcode.com/problems/remove-sub-folders-from-the-filesystem/">1233. Remove Sub-Folders from the Filesystem</a></h2><h3>Medium</h3><hr><div><p>Given a list of folders <code>folder</code>, return <em>the folders after removing all <strong>sub-folders</strong> in those folders</em>. You may return the answer in <strong>any order</strong>.</p>
2+
3+
<p>If a <code>folder[i]</code> is located within another <code>folder[j]</code>, it is called a <strong>sub-folder</strong> of it. A sub-folder of <code>folder[j]</code> must start with <code>folder[j]</code>, followed by a <code>"/"</code>. For example, <code>"/a/b"</code> is a sub-folder of <code>"/a"</code>, but <code>"/b"</code> is not a sub-folder of <code>"/a/b/c"</code>.</p>
4+
5+
<p>The format of a path is one or more concatenated strings of the form: <code>'/'</code> followed by one or more lowercase English letters.</p>
6+
7+
<ul>
8+
<li>For example, <code>"/leetcode"</code> and <code>"/leetcode/problems"</code> are valid paths while an empty string and <code>"/"</code> are not.</li>
9+
</ul>
10+
11+
<p>&nbsp;</p>
12+
<p><strong class="example">Example 1:</strong></p>
13+
14+
<pre><strong>Input:</strong> folder = ["/a","/a/b","/c/d","/c/d/e","/c/f"]
15+
<strong>Output:</strong> ["/a","/c/d","/c/f"]
16+
<strong>Explanation:</strong> Folders "/a/b" is a subfolder of "/a" and "/c/d/e" is inside of folder "/c/d" in our filesystem.
17+
</pre>
18+
19+
<p><strong class="example">Example 2:</strong></p>
20+
21+
<pre><strong>Input:</strong> folder = ["/a","/a/b/c","/a/b/d"]
22+
<strong>Output:</strong> ["/a"]
23+
<strong>Explanation:</strong> Folders "/a/b/c" and "/a/b/d" will be removed because they are subfolders of "/a".
24+
</pre>
25+
26+
<p><strong class="example">Example 3:</strong></p>
27+
28+
<pre><strong>Input:</strong> folder = ["/a/b/c","/a/b/ca","/a/b/d"]
29+
<strong>Output:</strong> ["/a/b/c","/a/b/ca","/a/b/d"]
30+
</pre>
31+
32+
<p>&nbsp;</p>
33+
<p><strong>Constraints:</strong></p>
34+
35+
<ul>
36+
<li><code>1 &lt;= folder.length &lt;= 4 * 10<sup>4</sup></code></li>
37+
<li><code>2 &lt;= folder[i].length &lt;= 100</code></li>
38+
<li><code>folder[i]</code> contains only lowercase letters and <code>'/'</code>.</li>
39+
<li><code>folder[i]</code> always starts with the character <code>'/'</code>.</li>
40+
<li>Each folder name is <strong>unique</strong>.</li>
41+
</ul>
42+
</div>

0 commit comments

Comments
 (0)