mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-06 07:51:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -22,8 +22,10 @@ dir
|
||||
|
||||
<p>Given a string <code>input</code> representing the file system in the explained format, return <em>the length of the <strong>longest absolute path</strong> to a <strong>file</strong> in the abstracted file system</em>. If there is no file in the system, return <code>0</code>.</p>
|
||||
|
||||
<p><strong>Note</strong> that the testcases are generated such that the file system is valid and no file or directory name has length 0.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/08/28/dir1.jpg" style="width: 401px; height: 202px;" />
|
||||
<pre>
|
||||
<strong>Input:</strong> input = "dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext"
|
||||
@@ -31,7 +33,7 @@ dir
|
||||
<strong>Explanation:</strong> We have only one file, and the absolute path is "dir/subdir2/file.ext" of length 20.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/08/28/dir2.jpg" style="width: 641px; height: 322px;" />
|
||||
<pre>
|
||||
<strong>Input:</strong> input = "dir\n\tsubdir1\n\t\tfile1.ext\n\t\tsubsubdir1\n\tsubdir2\n\t\tsubsubdir2\n\t\t\tfile2.ext"
|
||||
@@ -42,7 +44,7 @@ dir
|
||||
We return 32 since it is the longest absolute path to a file.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 3:</strong></p>
|
||||
<p><strong class="example">Example 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> input = "a"
|
||||
@@ -56,4 +58,5 @@ We return 32 since it is the longest absolute path to a file.
|
||||
<ul>
|
||||
<li><code>1 <= input.length <= 10<sup>4</sup></code></li>
|
||||
<li><code>input</code> may contain lowercase or uppercase English letters, a new line character <code>'\n'</code>, a tab character <code>'\t'</code>, a dot <code>'.'</code>, a space <code>' '</code>, and digits.</li>
|
||||
<li>All file and directory names have <strong>positive</strong> length.</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user