Skip to content

Commit 2ff1a3c

Browse files
author
openset
committed
Add: new
1 parent 9203338 commit 2ff1a3c

File tree

9 files changed

+46
-47
lines changed

9 files changed

+46
-47
lines changed

Diff for: problems/3sum-smaller/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
1. [3Sum](https://github.com/openset/leetcode/tree/master/problems/3sum) (Medium)
2222
1. [3Sum Closest](https://github.com/openset/leetcode/tree/master/problems/3sum-closest) (Medium)
2323
1. [Valid Triangle Number](https://github.com/openset/leetcode/tree/master/problems/valid-triangle-number) (Medium)
24+
1. [Two Sum Less Than K](https://github.com/openset/leetcode/tree/master/problems/two-sum-less-than-k) (Easy)

Diff for: problems/construct-quad-tree/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
[Next >](https://github.com/openset/leetcode/tree/master/problems/serialize-and-deserialize-n-ary-tree "Serialize and Deserialize N-ary Tree")
1111

12-
## 427. Construct Quad Tree (Easy)
12+
## 427. Construct Quad Tree (Medium)
1313

1414
<p>We want to use quad trees to store an <code>N x N</code> boolean grid. Each cell in the grid can only be true or false. The root node represents the whole grid. For each node, it will be subdivided into four children nodes <strong>until the values in the region it represents are all the same</strong>.</p>
1515

Diff for: problems/decode-string/README.md

+13-15
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,23 @@
1111

1212
## 394. Decode String (Medium)
1313

14-
<p>
15-
Given an encoded string, return it's decoded string.
16-
</p>
17-
<p>
18-
The encoding rule is: <code>k[encoded_string]</code>, where the <i>encoded_string</i> inside the square brackets is being repeated exactly <i>k</i> times. Note that <i>k</i> is guaranteed to be a positive integer.</p>
14+
<p>Given an encoded string, return its decoded string.</p>
1915

20-
<p>
21-
You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc.</p>
16+
<p>The encoding rule is: <code>k[encoded_string]</code>, where the <i>encoded_string</i> inside the square brackets is being repeated exactly <i>k</i> times. Note that <i>k</i> is guaranteed to be a positive integer.</p>
2217

23-
<p>Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, <i>k</i>. For example, there won't be input like <code>3a</code> or <code>2[4]</code>.
24-
</p>
18+
<p>You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc.</p>
19+
20+
<p>Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, <i>k</i>. For example, there won&#39;t be input like <code>3a</code> or <code>2[4]</code>.</p>
21+
22+
<p><b>Examples:</b></p>
2523

26-
<p><b>Examples:</b>
2724
<pre>
28-
s = "3[a]2[bc]", return "aaabcbc".
29-
s = "3[a2[c]]", return "accaccacc".
30-
s = "2[abc]3[cd]ef", return "abcabccdcdcdef".
25+
s = &quot;3[a]2[bc]&quot;, return &quot;aaabcbc&quot;.
26+
s = &quot;3[a2[c]]&quot;, return &quot;accaccacc&quot;.
27+
s = &quot;2[abc]3[cd]ef&quot;, return &quot;abcabccdcdcdef&quot;.
3128
</pre>
32-
</p>
29+
30+
<p>&nbsp;</p>
3331

3432
### Related Topics
3533
[[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)]
@@ -38,4 +36,4 @@ s = "2[abc]3[cd]ef", return "abcabccdcdcdef".
3836
### Similar Questions
3937
1. [Encode String with Shortest Length](https://github.com/openset/leetcode/tree/master/problems/encode-string-with-shortest-length) (Hard)
4038
1. [Number of Atoms](https://github.com/openset/leetcode/tree/master/problems/number-of-atoms) (Hard)
41-
1. [Permutation of Letters](https://github.com/openset/leetcode/tree/master/problems/permutation-of-letters) (Medium)
39+
1. [Brace Expansion](https://github.com/openset/leetcode/tree/master/problems/brace-expansion) (Medium)

Diff for: problems/linked-list-cycle-ii/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
<p>&nbsp;</p>
5353

54-
<p><b>Follow up</b>:<br />
54+
<p><b>Follow-up</b>:<br />
5555
Can you solve it without using extra space?</p>
5656

5757
### Related Topics

Diff for: problems/lru-cache/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
[Next >](https://github.com/openset/leetcode/tree/master/problems/insertion-sort-list "Insertion Sort List")
1111

12-
## 146. LRU Cache (Hard)
12+
## 146. LRU Cache (Medium)
1313

1414
<p>Design and implement a data structure for <a href="https://en.wikipedia.org/wiki/Cache_replacement_policies#LRU" target="_blank">Least Recently Used (LRU) cache</a>. It should support the following operations: <code>get</code> and <code>put</code>.</p>
1515

Diff for: problems/min-stack/README.md

+15-20
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,31 @@
1111

1212
## 155. Min Stack (Easy)
1313

14-
<p>
15-
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
14+
<p>Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.</p>
15+
1616
<ul>
17-
<li>
18-
push(x) -- Push element x onto stack.
19-
</li>
20-
<li>
21-
pop() -- Removes the element on top of the stack.
22-
</li>
23-
<li>
24-
top() -- Get the top element.
25-
</li>
26-
<li>
27-
getMin() -- Retrieve the minimum element in the stack.
28-
</li>
17+
<li>push(x) -- Push element x onto stack.</li>
18+
<li>pop() -- Removes the element on top of the stack.</li>
19+
<li>top() -- Get the top element.</li>
20+
<li>getMin() -- Retrieve the minimum element in the stack.</li>
2921
</ul>
30-
</p>
3122

32-
<p><b>Example:</b><br />
23+
<p>&nbsp;</p>
24+
25+
<p><b>Example:</b></p>
26+
3327
<pre>
3428
MinStack minStack = new MinStack();
3529
minStack.push(-2);
3630
minStack.push(0);
3731
minStack.push(-3);
38-
minStack.getMin(); --> Returns -3.
32+
minStack.getMin(); --&gt; Returns -3.
3933
minStack.pop();
40-
minStack.top(); --> Returns 0.
41-
minStack.getMin(); --> Returns -2.
34+
minStack.top(); --&gt; Returns 0.
35+
minStack.getMin(); --&gt; Returns -2.
4236
</pre>
43-
</p>
37+
38+
<p>&nbsp;</p>
4439

4540
### Related Topics
4641
[[Stack](https://github.com/openset/leetcode/tree/master/tag/stack/README.md)]

Diff for: problems/pacific-atlantic-water-flow/README.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,23 @@
1111

1212
## 417. Pacific Atlantic Water Flow (Medium)
1313

14-
<p>Given an <code>m x n</code> matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top edges of the matrix and the "Atlantic ocean" touches the right and bottom edges.</p>
14+
<p>Given an <code>m x n</code> matrix of non-negative integers representing the height of each unit cell in a continent, the &quot;Pacific ocean&quot; touches the left and top edges of the matrix and the &quot;Atlantic ocean&quot; touches the right and bottom edges.</p>
1515

1616
<p>Water can only flow in four directions (up, down, left, or right) from a cell to another one with height equal or lower.</p>
1717

1818
<p>Find the list of grid coordinates where water can flow to both the Pacific and Atlantic ocean.</p>
1919

20-
<p><b>Note:</b><br />
20+
<p><b>Note:</b></p>
21+
2122
<ol>
22-
<li>The order of returned grid coordinates does not matter.</li>
23-
<li>Both <i>m</i> and <i>n</i> are less than 150.</li>
23+
<li>The order of returned grid coordinates does not matter.</li>
24+
<li>Both <i>m</i> and <i>n</i> are less than 150.</li>
2425
</ol>
25-
</p>
26-
<p><b>Example:</b>
26+
27+
<p>&nbsp;</p>
28+
29+
<p><b>Example:</b></p>
30+
2731
<pre>
2832
Given the following 5x5 matrix:
2933

@@ -39,7 +43,8 @@ Return:
3943

4044
[[0, 4], [1, 3], [1, 4], [2, 2], [3, 0], [3, 1], [4, 0]] (positions with parentheses in above matrix).
4145
</pre>
42-
</p>
46+
47+
<p>&nbsp;</p>
4348

4449
### Related Topics
4550
[[Depth-first Search](https://github.com/openset/leetcode/tree/master/tag/depth-first-search/README.md)]

Diff for: problems/two-sum-ii-input-array-is-sorted/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@
3737
### Similar Questions
3838
1. [Two Sum](https://github.com/openset/leetcode/tree/master/problems/two-sum) (Easy)
3939
1. [Two Sum IV - Input is a BST](https://github.com/openset/leetcode/tree/master/problems/two-sum-iv-input-is-a-bst) (Easy)
40+
1. [Two Sum Less Than K](https://github.com/openset/leetcode/tree/master/problems/two-sum-less-than-k) (Easy)

Diff for: problems/two-sum/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ Because nums[<strong>0</strong>] + nums[<strong>1</strong>] = 2 + 7 = 9,
2424
return [<strong>0</strong>, <strong>1</strong>].
2525
</pre>
2626

27-
<p>&nbsp;</p>
28-
2927
### Related Topics
3028
[[Array](https://github.com/openset/leetcode/tree/master/tag/array/README.md)]
3129
[[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)]
@@ -37,3 +35,4 @@ return [<strong>0</strong>, <strong>1</strong>].
3735
1. [Two Sum III - Data structure design](https://github.com/openset/leetcode/tree/master/problems/two-sum-iii-data-structure-design) (Easy)
3836
1. [Subarray Sum Equals K](https://github.com/openset/leetcode/tree/master/problems/subarray-sum-equals-k) (Medium)
3937
1. [Two Sum IV - Input is a BST](https://github.com/openset/leetcode/tree/master/problems/two-sum-iv-input-is-a-bst) (Easy)
38+
1. [Two Sum Less Than K](https://github.com/openset/leetcode/tree/master/problems/two-sum-less-than-k) (Easy)

0 commit comments

Comments
 (0)