You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: solution/0000-0099/0049.Group Anagrams/README_EN.md
+32-12
Original file line number
Diff line number
Diff line change
@@ -19,21 +19,41 @@ tags:
19
19
20
20
<!-- description:start -->
21
21
22
-
<p>Given an array of strings <code>strs</code>, group <strong>the anagrams</strong> together. You can return the answer in <strong>any order</strong>.</p>
23
-
24
-
<p>An <strong>Anagram</strong> is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.</p>
22
+
<p>Given an array of strings <code>strs</code>, group the <spandata-keyword="anagram">anagrams</span> together. You can return the answer in <strong>any order</strong>.</p>
<li>There is no string in strs that can be rearranged to form <code>"bat"</code>.</li>
36
+
<li>The strings <code>"nat"</code> and <code>"tan"</code> are anagrams as they can be rearranged to form each other.</li>
37
+
<li>The strings <code>"ate"</code>, <code>"eat"</code>, and <code>"tea"</code> are anagrams as they can be rearranged to form each other.</li>
Copy file name to clipboardexpand all lines: solution/0000-0099/0071.Simplify Path/README_EN.md
+16-9
Original file line number
Diff line number
Diff line change
@@ -17,20 +17,27 @@ tags:
17
17
18
18
<!-- description:start -->
19
19
20
-
<p>Given an absolute path for a Unix-style file system, which begins with a slash <code>'/'</code>, transform this path into its <strong>simplified canonical path</strong>.</p>
20
+
<p>You are given an <em>absolute</em> path for a Unix-style file system, which always begins with a slash <code>'/'</code>. Your task is to transform this absolute path into its <strong>simplified canonical path</strong>.</p>
21
21
22
-
<p>In Unix-style file system context, a single period <code>'.'</code> signifies the current directory, a double period <code>".."</code> denotes moving up one directory level, and multiple slashes such as <code>"//"</code> are interpreted as a single slash. In this problem, treat sequences of periods not covered by the previous rules (like <code>"..."</code>) as valid names for files or directories.</p>
22
+
<p>The <em>rules</em> of a Unix-style file system are as follows:</p>
23
23
24
-
<p>The simplified canonical path should adhere to the following rules:</p>
24
+
<ul>
25
+
<li>A single period <code>'.'</code> represents the current directory.</li>
26
+
<li>A double period <code>'..'</code> represents the previous/parent directory.</li>
27
+
<li>Multiple consecutive slashes such as <code>'//'</code> and <code>'///'</code> are treated as a single slash <code>'/'</code>.</li>
28
+
<li>Any sequence of periods that does <strong>not match</strong> the rules above should be treated as a <strong>valid directory or</strong> <strong>file </strong><strong>name</strong>. For example, <code>'...' </code>and <code>'....'</code> are valid directory or file names.</li>
29
+
</ul>
30
+
31
+
<p>The simplified canonical path should follow these <em>rules</em>:</p>
25
32
26
33
<ul>
27
-
<li>It must start with a single slash <code>'/'</code>.</li>
28
-
<li>Directories within the path should be separated by only one slash <code>'/'</code>.</li>
29
-
<li>It should not end with a slash <code>'/'</code>, unless it's the root directory.</li>
30
-
<li>It should exclude any single or double periods used to denote current or parent directories.</li>
34
+
<li>The path must start with a single slash <code>'/'</code>.</li>
35
+
<li>Directories within the path must be separated by exactly one slash <code>'/'</code>.</li>
36
+
<li>The path must not end with a slash <code>'/'</code>, unless it is the root directory.</li>
37
+
<li>The path must not have any single or double periods (<code>'.'</code> and <code>'..'</code>) used to denote current or parent directories.</li>
31
38
</ul>
32
39
33
-
<p>Return the new path.</p>
40
+
<p>Return the <strong>simplified canonical path</strong>.</p>
34
41
35
42
<p> </p>
36
43
<p><strongclass="example">Example 1:</strong></p>
@@ -66,7 +73,7 @@ tags:
66
73
67
74
<p><strong>Explanation:</strong></p>
68
75
69
-
<p>A double period <code>".."</code> refers to the directory up a level.</p>
76
+
<p>A double period <code>".."</code> refers to the directory up a level (the parent directory).</p>
0 commit comments