Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 046997d

Browse files
author
Openset
committed
Update: description
1 parent afbc990 commit 046997d

File tree

8 files changed

+84
-29
lines changed

8 files changed

+84
-29
lines changed

‎problems/climbing-stairs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
### Similar Questions
4242
1. [Min Cost Climbing Stairs](https://github.com/openset/leetcode/tree/master/problems/min-cost-climbing-stairs) (Easy)
43+
1. [Fibonacci Number](https://github.com/openset/leetcode/tree/master/problems/fibonacci-number) (Easy)
4344

4445
### Hints
4546
1. To reach nth step, what could have been your previous steps? (Think about the step sizes)

‎problems/delete-node-in-a-linked-list/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
<p>Given linked list --&nbsp;head =&nbsp;[4,5,1,9], which looks like following:</p>
1313

14-
<p><img alt="" src="https://assets.leetcode.com/uploads/2018/12/28/237_example.png" style="margin-top: 5px; margin-bottom: 5px; width: 395px; height: 65px;" /></p>
14+
<p><img alt="" src="https://assets.leetcode.com/uploads/2018/12/28/237_example.png" style="margin-top: 5px; margin-bottom: 5px; width: 300px; height: 49px;" /></p>
15+
16+
<p>&nbsp;</p>
1517

1618
<p><strong>Example 1:</strong></p>
1719

@@ -29,6 +31,8 @@
2931
<strong>Explanation: </strong>You are given the third node with value 1, the linked list should become 4 -&gt; 5 -&gt; 9 after calling your function.
3032
</pre>
3133

34+
<p>&nbsp;</p>
35+
3236
<p><strong>Note:</strong></p>
3337

3438
<ul>

‎problems/flip-binary-tree-to-match-preorder-traversal/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
</div>
6565
</div>
6666

67+
6768
### Related Topics
6869
[[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)]
6970
[[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)]

‎problems/largest-palindrome-product/README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,24 @@
55
<!--|@home https://github.com/openset/leetcode |-->
66
<!--+----------------------------------------------------------------------+-->
77

8-
## 479. Largest Palindrome Product (Easy)
8+
## 479. Largest Palindrome Product (Hard)
99

1010
<p>Find the largest palindrome made from the product of two n-digit numbers.</p>
11-
<p> Since the result could be very large, you should return the largest palindrome mod 1337.</p>
1211

13-
<p><b>Example:</b>
12+
<p>Since the result could be very large, you should return the largest palindrome mod 1337.</p>
13+
14+
<p>&nbsp;</p>
15+
16+
<p><b>Example:</b></p>
17+
1418
<p>Input: 2</p>
19+
1520
<p>Output: 987</p>
16-
<p>Explanation: 99 x 91 = 9009, 9009 % 1337 = 987
17-
</p>
18-
</p>
1921

22+
<p>Explanation: 99 x 91 = 9009, 9009 % 1337 = 987</p>
23+
24+
<p>&nbsp;</p>
25+
26+
<p><b>Note:</b></p>
2027

21-
<p><b>Note:</b>
2228
<p>The range of n is [1,8].</p>
23-
</p>

‎problems/length-of-longest-fibonacci-subsequence/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ The longest subsequence that is fibonacci-like:
5656
### Related Topics
5757
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
5858
[[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)]
59+
60+
### Similar Questions
61+
1. [Fibonacci Number](https://github.com/openset/leetcode/tree/master/problems/fibonacci-number) (Easy)

‎problems/reverse-string/README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,28 @@
77

88
## 344. Reverse String (Easy)
99

10-
<p>Write a function that takes a string as input and returns the string reversed.</p>
10+
<p>Write a function that reverses a string. The input string is given as an array of characters <code>char[]</code>.</p>
1111

12-
<p><strong>Example 1:</strong></p>
12+
<p>Do not allocate extra space for another array, you must do this by <strong>modifying the input array&nbsp;<a href="https://en.wikipedia.org/wiki/In-place_algorithm" target="_blank">in-place</a></strong> with O(1) extra memory.</p>
13+
14+
<p>You may assume all the characters consist of <a href="https://en.wikipedia.org/wiki/ASCII#Printable_characters" target="_blank">printable ascii characters</a>.</p>
15+
16+
<p>&nbsp;</p>
1317

1418
<div>
19+
<p><strong>Example 1:</strong></p>
20+
1521
<pre>
16-
<strong>Input: </strong><span id="example-input-1-1">&quot;hello&quot;</span>
17-
<strong>Output: </strong><span id="example-output-1">&quot;olleh&quot;</span>
22+
<strong>Input: </strong><span id="example-input-1-1">[&quot;h&quot;,&quot;e&quot;,&quot;l&quot;,&quot;l&quot;,&quot;o&quot;]</span>
23+
<strong>Output: </strong><span id="example-output-1">[&quot;o&quot;,&quot;l&quot;,&quot;l&quot;,&quot;e&quot;,&quot;h&quot;]</span>
1824
</pre>
1925

2026
<div>
2127
<p><strong>Example 2:</strong></p>
2228

2329
<pre>
24-
<strong>Input: </strong><span id="example-input-2-1">&quot;A man, a plan, a canal: Panama&quot;</span>
25-
<strong>Output: </strong><span id="example-output-2">&quot;amanaP :lanac a ,nalp a ,nam A&quot;</span>
30+
<strong>Input: </strong><span id="example-input-2-1">[&quot;H&quot;,&quot;a&quot;,&quot;n&quot;,&quot;n&quot;,&quot;a&quot;,&quot;h&quot;]</span>
31+
<strong>Output: </strong><span id="example-output-2">[&quot;h&quot;,&quot;a&quot;,&quot;n&quot;,&quot;n&quot;,&quot;a&quot;,&quot;H&quot;]</span>
2632
</pre>
2733
</div>
2834
</div>

‎problems/simplify-path/README.md

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,58 @@
77

88
## 71. Simplify Path (Medium)
99

10-
<p>Given an absolute path for a file (Unix-style), simplify it.&nbsp;</p>
10+
<p>Given an <strong>absolute path</strong> for a file (Unix-style), simplify it. Or in other words, convert it to the <strong>canonical path</strong>.</p>
1111

12-
<p>For example,<br />
13-
<strong>path</strong> = <code>&quot;/home/&quot;</code>, =&gt; <code>&quot;/home&quot;</code><br />
14-
<strong>path</strong> = <code>&quot;/a/./b/../../c/&quot;</code>, =&gt; <code>&quot;/c&quot;</code><br />
15-
<strong>path</strong> = <code>&quot;/a/../../b/../c//.//&quot;</code>, =&gt; <code>&quot;/c&quot;</code><br />
16-
<strong>path</strong> = <code>&quot;/a//b////c/d//././/..&quot;</code>, =&gt; <code>&quot;/a/b/c&quot;</code></p>
12+
<p>In a UNIX-style file system, a period <code>.</code>&nbsp;refers to the current directory. Furthermore, a double period <code>..</code>&nbsp;moves the directory up a level. For more information, see:&nbsp;<a href="https://www.linuxnix.com/abslute-path-vs-relative-path-in-linuxunix/" target="_blank">Absolute path&nbsp;vs&nbsp;relative&nbsp;path&nbsp;in&nbsp;Linux/Unix</a></p>
1713

18-
<p>In a UNIX-style file system, a period (&#39;.&#39;) refers to the current directory, so it can be ignored in a simplified path. Additionally, a double period (&quot;..&quot;) moves up a directory, so it cancels out whatever the last directory was. For more information, look here:&nbsp;<ahref="https://en.wikipedia.org/wiki/Path_(computing)#Unix_style">https://en.wikipedia.org/wiki/Path_(computing)#Unix_style</a></p>
14+
<p>Note that the returned canonical path must always begin&nbsp;with a slash <code>/</code>, and there must be only a single slash <code>/</code>&nbsp;between two directory names.&nbsp;The last directory name (if it exists) <b>must not</b>&nbsp;end with a trailing <code>/</code>. Also, the canonical path must be the <strong>shortest</strong> string&nbsp;representing the absolute path.</p>
1915

20-
<p><strong>Corner Cases:</strong></p>
16+
<p>&nbsp;</p>
2117

22-
<ul>
23-
<li>Did you consider the case where <strong>path</strong> = <code>&quot;/../&quot;</code>?<br />
24-
In this case, you should return <code>&quot;/&quot;</code>.</li>
25-
<li>Another corner case is the path might contain multiple slashes <code>&#39;/&#39;</code> together, such as <code>&quot;/home//foo/&quot;</code>.<br />
26-
In this case, you should ignore redundant slashes and return <code>&quot;/home/foo&quot;</code>.</li>
27-
</ul>
18+
<p><strong>Example 1:</strong></p>
19+
20+
<pre>
21+
<strong>Input: &quot;</strong><span id="example-input-1-1">/home/&quot;</span>
22+
<strong>Output: &quot;</strong><span id="example-output-1">/home&quot;
23+
<strong>Explanation:</strong> Note that there is no trailing slash after the last directory name.</span>
24+
</pre>
25+
26+
<p><strong>Example 2:</strong></p>
27+
28+
<pre>
29+
<strong>Input: &quot;</strong><span id="example-input-1-1">/../&quot;</span>
30+
<strong>Output: &quot;</strong><span id="example-output-1">/&quot;</span>
31+
<strong>Explanation:</strong> Going one level up from the root directory is a no-op, as the root level is the highest level you can go.
32+
</pre>
33+
34+
<p><strong>Example 3:</strong></p>
35+
36+
<pre>
37+
<strong>Input: &quot;</strong><span id="example-input-1-1">/home//foo/&quot;</span>
38+
<strong>Output: &quot;</strong><span id="example-output-1">/home/foo&quot;</span>
39+
<strong>Explanation: </strong>In the canonical path, multiple consecutive slashes are replaced by a single one.
40+
</pre>
41+
42+
<p><strong>Example 4:</strong></p>
43+
44+
<pre>
45+
<strong>Input: &quot;</strong><span id="example-input-1-1">/a/./b/../../c/&quot;</span>
46+
<strong>Output: &quot;</strong><span id="example-output-1">/c&quot;</span>
47+
</pre>
48+
49+
<p><strong>Example 5:</strong></p>
50+
51+
<pre>
52+
<strong>Input: &quot;</strong><span id="example-input-1-1">/a/../../b/../c//.//&quot;</span>
53+
<strong>Output: &quot;</strong><span id="example-output-1">/c&quot;</span>
54+
</pre>
55+
56+
<p><strong>Example 6:</strong></p>
57+
58+
<pre>
59+
<strong>Input: &quot;</strong><span id="example-input-1-1">/a//b////c/d//././/..&quot;</span>
60+
<strong>Output: &quot;</strong><span id="example-output-1">/a/b/c&quot;</span>
61+
</pre>
2862

2963

3064
### Related Topics

‎problems/split-array-into-fibonacci-sequence/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@
7474

7575
### Similar Questions
7676
1. [Additive Number](https://github.com/openset/leetcode/tree/master/problems/additive-number) (Medium)
77+
1. [Fibonacci Number](https://github.com/openset/leetcode/tree/master/problems/fibonacci-number) (Easy)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /