Skip to content

Commit dfcdbf3

Browse files
author
openset
committed
Update: description
1 parent 7c96333 commit dfcdbf3

File tree

7 files changed

+50
-40
lines changed

7 files changed

+50
-40
lines changed

problems/evaluate-division/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,25 @@
1111

1212
## 399. Evaluate Division (Medium)
1313

14-
<p>
15-
Equations are given in the format <code>A / B = k</code>, where <code>A</code> and <code>B</code> are variables represented as strings, and <code>k</code> is a real number (floating point number). Given some queries, return the answers. If the answer does not exist, return <code>-1.0</code>.
16-
</p>
17-
<p><b>Example:</b><br/>
18-
Given <code> a / b = 2.0, b / c = 3.0.</code> <br/>queries are: <code> a / c = ?, b / a = ?, a / e = ?, a / a = ?, x / x = ? .</code> <br/>return <code> [6.0, 0.5, -1.0, 1.0, -1.0 ].</code>
19-
</p>
20-
<p>
21-
The input is: <code> vector&lt;pair&lt;string, string&gt;&gt; equations, vector&lt;double&gt;&amp; values, vector&lt;pair&lt;string, string&gt;&gt; queries </code>, where <code>equations.size() == values.size()</code>, and the values are positive. This represents the equations. Return <code> vector&lt;double&gt;</code>.
22-
</p>
23-
24-
<p>According to the example above:
25-
<pre>equations = [ ["a", "b"], ["b", "c"] ],
14+
<p>Equations are given in the format <code>A / B = k</code>, where <code>A</code> and <code>B</code> are variables represented as strings, and <code>k</code> is a real number (floating point number). Given some queries, return the answers. If the answer does not exist, return <code>-1.0</code>.</p>
15+
16+
<p><b>Example:</b><br />
17+
Given <code> a / b = 2.0, b / c = 3.0.</code><br />
18+
queries are: <code> a / c = ?, b / a = ?, a / e = ?, a / a = ?, x / x = ? .</code><br />
19+
return <code> [6.0, 0.5, -1.0, 1.0, -1.0 ].</code></p>
20+
21+
<p>The input is: <code> vector&lt;pair&lt;string, string&gt;&gt; equations, vector&lt;double&gt;&amp; values, vector&lt;pair&lt;string, string&gt;&gt; queries </code>, where <code>equations.size() == values.size()</code>, and the values are positive. This represents the equations. Return <code> vector&lt;double&gt;</code>.</p>
22+
23+
<p>According to the example above:</p>
24+
25+
<pre>
26+
equations = [ [&quot;a&quot;, &quot;b&quot;], [&quot;b&quot;, &quot;c&quot;] ],
2627
values = [2.0, 3.0],
27-
queries = [ ["a", "c"], ["b", "a"], ["a", "e"], ["a", "a"], ["x", "x"] ]. </pre>
28-
</p>
28+
queries = [ [&quot;a&quot;, &quot;c&quot;], [&quot;b&quot;, &quot;a&quot;], [&quot;a&quot;, &quot;e&quot;], [&quot;a&quot;, &quot;a&quot;], [&quot;x&quot;, &quot;x&quot;] ]. </pre>
29+
30+
<p>&nbsp;</p>
2931

30-
<p>
31-
The input is always valid. You may assume that evaluating the queries will result in no division by zero and there is no contradiction.
32-
</p>
32+
<p>The input is always valid. You may assume that evaluating the queries will result in no division by zero and there is no contradiction.</p>
3333

3434
### Related Topics
3535
[[Union Find](https://github.com/openset/leetcode/tree/master/tag/union-find/README.md)]

problems/perfect-rectangle/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,6 @@ Return false. Because two of the rectangles overlap with each other.
8989
</pre>
9090

9191
<p>&nbsp;</p>
92+
93+
### Related Topics
94+
[[Line Sweep](https://github.com/openset/leetcode/tree/master/tag/line-sweep/README.md)]

problems/rectangle-area-ii/README.md

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

4545
### Related Topics
4646
[[Segment Tree](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)]
47+
[[Line Sweep](https://github.com/openset/leetcode/tree/master/tag/line-sweep/README.md)]

problems/single-element-in-a-sorted-array/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@
1111

1212
## 540. Single Element in a Sorted Array (Medium)
1313

14-
<p>
15-
Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element that appears only once.
16-
</p>
14+
<p>Given a sorted array consisting of only integers where every element appears exactly twice except for one element which appears exactly&nbsp;once. Find this single element that appears only once.</p>
15+
16+
<p>&nbsp;</p>
17+
18+
<p><b>Example 1:</b></p>
1719

18-
<p><b>Example 1:</b><br />
1920
<pre>
2021
<b>Input:</b> [1,1,2,3,3,4,4,8,8]
2122
<b>Output:</b> 2
2223
</pre>
23-
</p>
2424

25-
<p><b>Example 2:</b><br />
25+
<p><b>Example 2:</b></p>
26+
2627
<pre>
2728
<b>Input:</b> [3,3,7,7,10,11,11]
2829
<b>Output:</b> 10
2930
</pre>
30-
</p>
3131

32-
<p><b>Note:</b>
33-
Your solution should run in O(log n) time and O(1) space.
34-
</p>
32+
<p>&nbsp;</p>
33+
34+
<p><b>Note:</b> Your solution should run in O(log n) time and O(1) space.</p>

problems/symmetric-tree/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,32 @@
1313

1414
<p>Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).</p>
1515

16-
<p>
17-
For example, this binary tree <code>[1,2,2,3,4,4,3]</code> is symmetric:
16+
<p>For example, this binary tree <code>[1,2,2,3,4,4,3]</code> is symmetric:</p>
17+
1818
<pre>
1919
1
2020
/ \
2121
2 2
2222
/ \ / \
2323
3 4 4 3
2424
</pre>
25-
</p>
26-
<p>
27-
But the following <code>[1,2,2,null,3,null,3]</code> is not:<br />
25+
26+
<p>&nbsp;</p>
27+
28+
<p>But the following <code>[1,2,2,null,3,null,3]</code> is not:</p>
29+
2830
<pre>
2931
1
3032
/ \
3133
2 2
3234
\ \
3335
3 3
3436
</pre>
35-
</p>
3637

37-
<p>
38-
<b>Note:</b><br />
39-
Bonus points if you could solve it both recursively and iteratively.
40-
</p>
38+
<p>&nbsp;</p>
39+
40+
<p><b>Note:</b><br />
41+
Bonus points if you could solve it both recursively and iteratively.</p>
4142

4243
### Related Topics
4344
[[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)]

problems/the-skyline-problem/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
[[Binary Indexed Tree](https://github.com/openset/leetcode/tree/master/tag/binary-indexed-tree/README.md)]
3737
[[Segment Tree](https://github.com/openset/leetcode/tree/master/tag/segment-tree/README.md)]
3838
[[Divide and Conquer](https://github.com/openset/leetcode/tree/master/tag/divide-and-conquer/README.md)]
39+
[[Line Sweep](https://github.com/openset/leetcode/tree/master/tag/line-sweep/README.md)]
3940

4041
### Similar Questions
4142
1. [Falling Squares](https://github.com/openset/leetcode/tree/master/problems/falling-squares) (Hard)

problems/validate-binary-search-tree/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@
2121
<li>Both the left and right subtrees must also be binary search trees.</li>
2222
</ul>
2323

24+
<p>&nbsp;</p>
25+
2426
<p><strong>Example 1:</strong></p>
2527

2628
<pre>
27-
<strong>Input:</strong>
2829
2
2930
/ \
3031
1 3
32+
33+
<strong>Input:</strong>&nbsp;[2,1,3]
3134
<strong>Output:</strong> true
3235
</pre>
3336

@@ -39,9 +42,10 @@
3942
1 4
4043
&nbsp; / \
4144
&nbsp; 3 6
45+
46+
<strong>Input:</strong> [5,1,4,null,null,3,6]
4247
<strong>Output:</strong> false
43-
<strong>Explanation:</strong> The input is: [5,1,4,null,null,3,6]. The root node&#39;s value
44-
&nbsp; is 5 but its right child&#39;s value is 4.
48+
<strong>Explanation:</strong> The root node&#39;s value is 5 but its right child&#39;s value is 4.
4549
</pre>
4650

4751
### Related Topics

0 commit comments

Comments
 (0)