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: problems/construct-quad-tree/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
10
10
[Next >](https://github.com/openset/leetcode/tree/master/problems/serialize-and-deserialize-n-ary-tree"Serialize and Deserialize N-ary Tree")
11
11
12
-
## 427. Construct Quad Tree (Easy)
12
+
## 427. Construct Quad Tree (Medium)
13
13
14
14
<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>
Copy file name to clipboardExpand all lines: problems/decode-string/README.md
+13-15Lines changed: 13 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,25 +11,23 @@
11
11
12
12
## 394. Decode String (Medium)
13
13
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>
19
15
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>
22
17
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't be input like <code>3a</code> or <code>2[4]</code>.</p>
21
+
22
+
<p><b>Examples:</b></p>
25
23
26
-
<p><b>Examples:</b>
27
24
<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 = "3[a]2[bc]", return "aaabcbc".
26
+
s = "3[a2[c]]", return "accaccacc".
27
+
s = "2[abc]3[cd]ef", return "abcabccdcdcdef".
<p>Design and implement a data structure for <ahref="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>
Copy file name to clipboardExpand all lines: problems/pacific-atlantic-water-flow/README.md
+12-7Lines changed: 12 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,19 +11,23 @@
11
11
12
12
## 417. Pacific Atlantic Water Flow (Medium)
13
13
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 "Pacific ocean" touches the left and top edges of the matrix and the "Atlantic ocean" touches the right and bottom edges.</p>
15
15
16
16
<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>
17
17
18
18
<p>Find the list of grid coordinates where water can flow to both the Pacific and Atlantic ocean.</p>
19
19
20
-
<p><b>Note:</b><br />
20
+
<p><b>Note:</b></p>
21
+
21
22
<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>
24
25
</ol>
25
-
</p>
26
-
<p><b>Example:</b>
26
+
27
+
<p> </p>
28
+
29
+
<p><b>Example:</b></p>
30
+
27
31
<pre>
28
32
Given the following 5x5 matrix:
29
33
@@ -39,7 +43,8 @@ Return:
39
43
40
44
[[0, 4], [1, 3], [1, 4], [2, 2], [3, 0], [3, 1], [4, 0]] (positions with parentheses in above matrix).
0 commit comments