Skip to content

Commit df2d452

Browse files
committed
fix: update README.md
1 parent 678337b commit df2d452

File tree

110 files changed

+1349
-799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1349
-799
lines changed

lcci/01.01.Is Unique/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [01.01. Is Unique](https://leetcode-cn.com/problems/is-unique-lcci)
22

3+
[中文文档](/lcci/01.01.Is%20Unique/README.md)
4+
35
## Description
46
<p>Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?</p>
57

lcci/01.02.Check Permutation/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [01.02. Check Permutation](https://leetcode-cn.com/problems/check-permutation-lcci)
22

3+
[中文文档](/lcci/01.02.Check%20Permutation/README.md)
4+
35
## Description
46
<p>Given two strings,write a method to decide if one is a permutation of the other.</p>
57

lcci/01.03.String to URL/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [01.03. String to URL](https://leetcode-cn.com/problems/string-to-url-lcci)
22

3+
[中文文档](/lcci/01.03.String%20to%20URL/README.md)
4+
35
## Description
46
<p>Write a method to replace all spaces in a string with &#39;%20&#39;. You may assume that the string has sufficient space at the end to hold the additional characters,and that you are given the &quot;true&quot; length of the string. (Note: If implementing in Java,please use a character array so that you can perform this operation in place.)</p>
57

lcci/01.04.Palindrome Permutation/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [01.04. Palindrome Permutation](https://leetcode-cn.com/problems/palindrome-permutation-lcci)
22

3+
[中文文档](/lcci/01.04.Palindrome%20Permutation/README.md)
4+
35
## Description
46
<p>Given a string, write a function to check if it is a permutation of a palin&shy; drome. A palindrome is a word or phrase that is the same forwards and backwards. A permutation is a rearrangement of letters. The palindrome does not need to be limited to just dictionary words.</p>
57

lcci/01.05.One Away/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [01.05. One Away](https://leetcode-cn.com/problems/one-away-lcci)
22

3+
[中文文档](/lcci/01.05.One%20Away/README.md)
4+
35
## Description
46
<p>There are three types of edits that can be performed on strings: insert a character, remove a character, or replace a character. Given two strings, write a function to check if they are one edit (or zero edits) away.</p>
57

lcci/01.06.Compress String/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [01.06. Compress String](https://leetcode-cn.com/problems/compress-string-lcci)
22

3+
[中文文档](/lcci/01.06.Compress%20String/README.md)
4+
35
## Description
46
<p>Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the &quot;compressed&quot; string would not become smaller than the original string, your method should return the original string. You can assume the string has only uppercase and lowercase letters (a - z).</p>
57

lcci/01.07.Rotate Matrix/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [01.07. Rotate Matrix](https://leetcode-cn.com/problems/rotate-matrix-lcci)
22

3+
[中文文档](/lcci/01.07.Rotate%20Matrix/README.md)
4+
35
## Description
46
<p>Given an image represented by an N x N matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do this in place?</p>
57

lcci/01.08.Zero Matrix/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [01.08. Zero Matrix](https://leetcode-cn.com/problems/zero-matrix-lcci)
22

3+
[中文文档](/lcci/01.08.Zero%20Matrix/README.md)
4+
35
## Description
46
<p>Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0.</p>
57

lcci/01.09.String Rotation/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [01.09. String Rotation](https://leetcode-cn.com/problems/string-rotation-lcci)
22

3+
[中文文档](/lcci/01.09.String%20Rotation/README.md)
4+
35
## Description
46
<p>Given two strings, <code>s1</code>&nbsp;and <code>s2</code>, write code to check if <code>s2</code> is a rotation of <code>s1</code> (e.g.,&quot;waterbottle&quot; is a rotation of&quot;erbottlewat&quot;).&nbsp;Can you use&nbsp;only one call to the method that&nbsp;checks if one word is a substring of another?</p>
57

lcci/02.01.Remove Duplicate Node/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [02.01. Remove Duplicate Node](https://leetcode-cn.com/problems/remove-duplicate-node-lcci)
22

3+
[中文文档](/lcci/02.01.Remove%20Duplicate%20Node/README.md)
4+
35
## Description
46
<p>Write code to remove duplicates from an unsorted linked list.</p>
57

lcci/02.02.Kth Node From End of List/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [02.02. Kth Node From End of List](https://leetcode-cn.com/problems/kth-node-from-end-of-list-lcci)
22

3+
[中文文档](/lcci/02.02.Kth%20Node%20From%20End%20of%20List/README.md)
4+
35
## Description
46
<p>Implement an algorithm to find the kth to last element of a singly linked list.&nbsp;Return the value of the element.</p>
57

lcci/02.03.Delete Middle Node/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [02.03. Delete Middle Node](https://leetcode-cn.com/problems/delete-middle-node-lcci)
22

3+
[中文文档](/lcci/02.03.Delete%20Middle%20Node/README.md)
4+
35
## Description
46
<p>Implement an algorithm to delete a node in the middle (i.e., any node but the first and last node, not necessarily the exact middle) of a singly linked list, given only access to that node.</p>
57

lcci/02.04.Partition List/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [02.04. Partition List](https://leetcode-cn.com/problems/partition-list-lcci)
22

3+
[中文文档](/lcci/02.04.Partition%20List/README.md)
4+
35
## Description
46
<p>Write code to partition a linked list around a value x, such that all nodes less than x come before all nodes greater than or equal to x. If x is contained within the list, the values of x only need to be after the elements less than x (see below). The partition element x can appear anywhere in the &quot;right partition&quot;; it does not need to appear between the left and right partitions.</p>
57

lcci/02.05.Sum Lists/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [02.05. Sum Lists](https://leetcode-cn.com/problems/sum-lists-lcci)
22

3+
[中文文档](/lcci/02.05.Sum%20Lists/README.md)
4+
35
## Description
46
<p>You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1&#39;s digit is at the head of the list. Write a function that adds the two numbers and returns the sum as a linked list.</p>
57

lcci/02.06.Palindrome Linked List/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [02.06. Palindrome Linked List](https://leetcode-cn.com/problems/palindrome-linked-list-lcci)
22

3+
[中文文档](/lcci/02.06.Palindrome%20Linked%20List/README.md)
4+
35
## Description
46
<p>Implement a function to check if a linked list is a palindrome.</p>
57

lcci/02.07.Intersection of Two Linked Lists/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [02.07. Intersection of Two Linked Lists](https://leetcode-cn.com/problems/intersection-of-two-linked-lists-lcci)
22

3+
[中文文档](/lcci/02.07.Intersection%20of%20Two%20Linked%20Lists/README.md)
4+
35
## Description
46
<p>Given two (singly) linked lists, determine if the two lists intersect. Return the inter&shy; secting node. Note that the intersection is defined based on reference, not value. That is, if the kth node of the first linked list is the exact same node (by reference) as the jth node of the second linked list, then they are intersecting.</p>
57

lcci/02.08.Linked List Cycle/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [02.08. Linked List Cycle](https://leetcode-cn.com/problems/linked-list-cycle-lcci)
22

3+
[中文文档](/lcci/02.08.Linked%20List%20Cycle/README.md)
4+
35
## Description
46
<p>Given a circular linked list, implement an algorithm that returns the node at the beginning of the loop.</p>
57

lcci/03.01.Three in One/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [03.01. Three in One](https://leetcode-cn.com/problems/three-in-one-lcci)
22

3+
[中文文档](/lcci/03.01.Three%20in%20One/README.md)
4+
35
## Description
46
<p>Describe how you could use a single array to implement three stacks.</p>
57

lcci/03.02.Min Stack/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [03.02. Min Stack](https://leetcode-cn.com/problems/min-stack-lcci)
22

3+
[中文文档](/lcci/03.02.Min%20Stack/README.md)
4+
35
## Description
46
<p>How would you design a stack which, in addition to push and pop, has a function min which returns the minimum element? Push, pop and min should all operate in 0(1) time.</p>
57

+75-49
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,75 @@
1-
# [03.03. Stack of Plates](https://leetcode-cn.com/problems/stack-of-plates-lcci)
2-
3-
## Description
4-
<p>Imagine a (literal) stack of plates. If the stack gets too high, it might topple. Therefore, in real life, we would likely start a new stack when the previous stack exceeds some threshold. Implement a data structure <code>SetOfStacks</code> that mimics this.&nbsp;<code>SetOfStacks</code> should be composed of several stacks and should create a new stack once the previous one exceeds capacity. <code>SetOfStacks.push()</code> and <code>SetOfStacks.pop()</code> should behave identically to a single stack (that is, <code>pop()</code> should return the same values as it would if there were just a single stack). Follow Up: Implement a function <code>popAt(int index)</code> which performs a pop operation on a specific sub-stack.</p>
5-
6-
<p>You should delete the sub-stack when it becomes empty. <code>pop</code>, <code>popAt</code> should return -1 when there&#39;s no element to pop.</p>
7-
8-
<p><strong>Example1:</strong></p>
9-
10-
<pre>
11-
<strong> Input</strong>:
12-
[&quot;StackOfPlates&quot;, &quot;push&quot;, &quot;push&quot;, &quot;popAt&quot;, &quot;pop&quot;, &quot;pop&quot;]
13-
[[1], [1], [2], [1], [], []]
14-
<strong> Output</strong>:
15-
[null, null, null, 2, 1, -1]
16-
<strong> Explanation</strong>:
17-
</pre>
18-
19-
<p><strong>Example2:</strong></p>
20-
21-
<pre>
22-
<strong> Input</strong>:
23-
[&quot;StackOfPlates&quot;, &quot;push&quot;, &quot;push&quot;, &quot;push&quot;, &quot;popAt&quot;, &quot;popAt&quot;, &quot;popAt&quot;]
24-
[[2], [1], [2], [3], [0], [0], [0]]
25-
<strong> Output</strong>:
26-
[null, null, null, null, 2, 1, 3]
27-
</pre>
28-
29-
30-
31-
## Solutions
32-
33-
34-
### Python3
35-
36-
```python
37-
38-
```
39-
40-
### Java
41-
42-
```java
43-
44-
```
45-
46-
### ...
47-
```
48-
49-
```
1+
# [03.03. Stack of Plates](https://leetcode-cn.com/problems/stack-of-plates-lcci)
2+
3+
[中文文档](/lcci/03.03.Stack%20of%20Plates/README.md)
4+
5+
## Description
6+
<p>Imagine a (literal) stack of plates. If the stack gets too high, it might topple. Therefore, in real life, we would likely start a new stack when the previous stack exceeds some threshold. Implement a data structure <code>SetOfStacks</code> that mimics this.&nbsp;<code>SetOfStacks</code> should be composed of several stacks and should create a new stack once the previous one exceeds capacity. <code>SetOfStacks.push()</code> and <code>SetOfStacks.pop()</code> should behave identically to a single stack (that is, <code>pop()</code> should return the same values as it would if there were just a single stack). Follow Up: Implement a function <code>popAt(int index)</code> which performs a pop operation on a specific sub-stack.</p>
7+
8+
9+
10+
<p>You should delete the sub-stack when it becomes empty. <code>pop</code>, <code>popAt</code> should return -1 when there&#39;s no element to pop.</p>
11+
12+
13+
14+
<p><strong>Example1:</strong></p>
15+
16+
17+
18+
<pre>
19+
20+
<strong> Input</strong>:
21+
22+
[&quot;StackOfPlates&quot;, &quot;push&quot;, &quot;push&quot;, &quot;popAt&quot;, &quot;pop&quot;, &quot;pop&quot;]
23+
24+
[[1], [1], [2], [1], [], []]
25+
26+
<strong> Output</strong>:
27+
28+
[null, null, null, 2, 1, -1]
29+
30+
<strong> Explanation</strong>:
31+
32+
</pre>
33+
34+
35+
36+
<p><strong>Example2:</strong></p>
37+
38+
39+
40+
<pre>
41+
42+
<strong> Input</strong>:
43+
44+
[&quot;StackOfPlates&quot;, &quot;push&quot;, &quot;push&quot;, &quot;push&quot;, &quot;popAt&quot;, &quot;popAt&quot;, &quot;popAt&quot;]
45+
46+
[[2], [1], [2], [3], [0], [0], [0]]
47+
48+
<strong> Output</strong>:
49+
50+
[null, null, null, null, 2, 1, 3]
51+
52+
</pre>
53+
54+
55+
56+
57+
## Solutions
58+
59+
60+
### Python3
61+
62+
```python
63+
64+
```
65+
66+
### Java
67+
68+
```java
69+
70+
```
71+
72+
### ...
73+
```
74+
75+
```

lcci/03.04.Implement Queue using Stacks/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [03.04. Implement Queue using Stacks](https://leetcode-cn.com/problems/implement-queue-using-stacks-lcci)
22

3+
[中文文档](/lcci/03.04.Implement%20Queue%20using%20Stacks/README.md)
4+
35
## Description
46
<p>Implement a MyQueue class which implements a queue using two stacks.</p>
57

lcci/03.05.Sort of Stacks/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [03.05. Sort of Stacks](https://leetcode-cn.com/problems/sort-of-stacks-lcci)
22

3+
[中文文档](/lcci/03.05.Sort%20of%20Stacks/README.md)
4+
35
## Description
46
<p>Write a program to sort a stack such that the smallest items are on the top. You can use an additional temporary stack, but you may not copy the elements into any other data structure (such as an array). The stack supports the following operations: <code>push</code>, <code>pop</code>, <code>peek</code>, and <code>isEmpty</code>. When the stack is empty, <code>peek</code> should return -1.</p>
57

lcci/03.06.Animal Shelter/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [03.06. Animal Shelter](https://leetcode-cn.com/problems/animal-shelter-lcci)
22

3+
[中文文档](/lcci/03.06.Animal%20Shelter/README.md)
4+
35
## Description
46
<p>An animal shelter, which holds only dogs and cats, operates on a strictly&quot;first in, first out&quot; basis. People must adopt either the&quot;oldest&quot; (based on arrival time) of all animals at the shelter, or they can select whether they would prefer a dog or a cat (and will receive the oldest animal of that type). They cannot select which specific animal they would like. Create the data structures to maintain this system and implement operations such as <code>enqueue</code>, <code>dequeueAny</code>, <code>dequeueDog</code>, and <code>dequeueCat</code>. You may use the built-in Linked list data structure.</p>
57

lcci/04.01.Route Between Nodes/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# [04.01. Route Between Nodes](https://leetcode-cn.com/problems/route-between-nodes-lcci)
22

3+
[中文文档](/lcci/04.01.Route%20Between%20Nodes/README.md)
4+
35
## Description
46
<p>Given a directed graph, design an algorithm to find out whether there is a route between two nodes.</p>
57

0 commit comments

Comments
 (0)