Skip to content

Commit 5bb90bd

Browse files
author
Shuo
authored
Merge pull request #711 from openset/develop
Update: chan
2 parents 5ccd5bd + 42a34e7 commit 5bb90bd

File tree

3 files changed

+16
-26
lines changed

3 files changed

+16
-26
lines changed

internal/description/description.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ func runDescription(cmd *base.Command, args []string) {
2323
return
2424
}
2525
var wg sync.WaitGroup
26-
limit := 1 << 7
27-
jobs := make(chan leetcode.StatStatusPairsType, limit)
28-
for i := 0; i < limit; i++ {
26+
jobs := make(chan leetcode.StatStatusPairsType)
27+
for i := 0; i < 1<<7; i++ {
2928
go worker(jobs, &wg)
3029
}
3130
problems := leetcode.ProblemsAll()

problems/closest-binary-search-tree-value/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515

1616
### Related Topics
17-
[[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)]
1817
[[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)]
18+
[[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)]
1919

2020
### Similar Questions
2121
1. [Count Complete Tree Nodes](https://github.com/openset/leetcode/tree/master/problems/count-complete-tree-nodes) (Medium)

problems/verifying-an-alien-dictionary/README.md

+13-22
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,40 @@
1414
<p>In an alien language, surprisingly they also use english lowercase letters, but possibly&nbsp;in a different <code>order</code>. The&nbsp;<code>order</code> of the alphabet&nbsp;is some permutation&nbsp;of lowercase letters.</p>
1515

1616
<p>Given a sequence of <code>words</code>&nbsp;written in the alien language,&nbsp;and the <code>order</code> of the alphabet,&nbsp;return <code>true</code> if and only if the given <code>words</code>&nbsp;are sorted lexicographicaly in this alien language.</p>
17-
1817
<p>&nbsp;</p>
19-
20-
<div>
2118
<p><strong>Example 1:</strong></p>
2219

2320
<pre>
24-
<strong>Input: </strong>words = <span id="example-input-1-1">[&quot;hello&quot;,&quot;leetcode&quot;]</span>, order = <span id="example-input-1-2">&quot;hlabcdefgijkmnopqrstuvwxyz&quot;</span>
25-
<strong>Output: </strong><span id="example-output-1">true</span>
26-
<strong>Explanation: </strong><span id="example-output-1">As &#39;h&#39; comes before &#39;l&#39; in this language, then the sequence is sorted.</span>
21+
<strong>Input:</strong> words = [&quot;hello&quot;,&quot;leetcode&quot;], order = &quot;hlabcdefgijkmnopqrstuvwxyz&quot;
22+
<strong>Output:</strong> true
23+
<strong>Explanation: </strong>As &#39;h&#39; comes before &#39;l&#39; in this language, then the sequence is sorted.
2724
</pre>
2825

29-
<div>
3026
<p><strong>Example 2:</strong></p>
3127

3228
<pre>
33-
<strong>Input: </strong>words = <span id="example-input-2-1">[&quot;word&quot;,&quot;world&quot;,&quot;row&quot;]</span>, order = <span id="example-input-2-2">&quot;worldabcefghijkmnpqstuvxyz&quot;</span>
34-
<strong>Output: </strong><span id="example-output-2">false</span>
35-
<strong>Explanation: </strong><span id="example-output-1">As &#39;d&#39; comes after &#39;l&#39; in this language, then words[0] &gt; words[1], hence the sequence is unsorted.</span>
29+
<strong>Input:</strong> words = [&quot;word&quot;,&quot;world&quot;,&quot;row&quot;], order = &quot;worldabcefghijkmnpqstuvxyz&quot;
30+
<strong>Output:</strong> false
31+
<strong>Explanation: </strong>As &#39;d&#39; comes after &#39;l&#39; in this language, then words[0] &gt; words[1], hence the sequence is unsorted.
3632
</pre>
3733

38-
<div>
3934
<p><strong>Example 3:</strong></p>
4035

4136
<pre>
42-
<strong>Input: </strong>words = <span id="example-input-3-1">[&quot;apple&quot;,&quot;app&quot;]</span>, order = <span id="example-input-3-2">&quot;abcdefghijklmnopqrstuvwxyz&quot;</span>
43-
<strong>Output: </strong><span id="example-output-3">false
44-
</span><strong>Explanation: </strong>The first three characters &quot;app&quot; match, and the second string is shorter (in size.) According to lexicographical rules &quot;apple&quot; &gt; &quot;app&quot;, because &#39;l&#39; &gt; &#39;&empty;&#39;, where &#39;&empty;&#39; is defined as the blank character which is less than any other character (<a href="https://en.wikipedia.org/wiki/Lexicographical_order" target="_blank">More info</a>).
37+
<strong>Input:</strong> words = [&quot;apple&quot;,&quot;app&quot;], order = &quot;abcdefghijklmnopqrstuvwxyz&quot;
38+
<strong>Output:</strong> false
39+
<strong>Explanation: </strong>The first three characters &quot;app&quot; match, and the second string is shorter (in size.) According to lexicographical rules &quot;apple&quot; &gt; &quot;app&quot;, because &#39;l&#39; &gt; &#39;&empty;&#39;, where &#39;&empty;&#39; is defined as the blank character which is less than any other character (<a href="https://en.wikipedia.org/wiki/Lexicographical_order" target="_blank">More info</a>).
4540
</pre>
4641

4742
<p>&nbsp;</p>
43+
<p><strong>Constraints:</strong></p>
4844

49-
<p><strong>Note:</strong></p>
50-
51-
<ol>
45+
<ul>
5246
<li><code>1 &lt;= words.length &lt;= 100</code></li>
5347
<li><code>1 &lt;= words[i].length &lt;= 20</code></li>
5448
<li><code>order.length == 26</code></li>
55-
<li>All characters in <code>words[i]</code> and <code>order</code> are english lowercase letters.</li>
56-
</ol>
57-
</div>
58-
</div>
59-
</div>
49+
<li>All characters in <code>words[i]</code> and <code>order</code> are English lowercase letters.</li>
50+
</ul>
6051

6152
### Related Topics
6253
[[Hash Table](https://github.com/openset/leetcode/tree/master/tag/hash-table/README.md)]

0 commit comments

Comments
 (0)