diff --git a/internal/description/description.go b/internal/description/description.go index 97aa7d045..01f445d07 100644 --- a/internal/description/description.go +++ b/internal/description/description.go @@ -23,9 +23,8 @@ func runDescription(cmd *base.Command, args []string) { return } var wg sync.WaitGroup - limit := 1 << 7 - jobs := make(chan leetcode.StatStatusPairsType, limit) - for i := 0; i < limit; i++ { + jobs := make(chan leetcode.StatStatusPairsType) + for i := 0; i < 1<<7; i++ { go worker(jobs, &wg) } problems := leetcode.ProblemsAll() diff --git a/problems/closest-binary-search-tree-value/README.md b/problems/closest-binary-search-tree-value/README.md index 1a22d9301..8a56c2db9 100644 --- a/problems/closest-binary-search-tree-value/README.md +++ b/problems/closest-binary-search-tree-value/README.md @@ -14,8 +14,8 @@ ### Related Topics - [[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] [[Tree](https://github.com/openset/leetcode/tree/master/tag/tree/README.md)] + [[Binary Search](https://github.com/openset/leetcode/tree/master/tag/binary-search/README.md)] ### Similar Questions 1. [Count Complete Tree Nodes](https://github.com/openset/leetcode/tree/master/problems/count-complete-tree-nodes) (Medium) diff --git a/problems/verifying-an-alien-dictionary/README.md b/problems/verifying-an-alien-dictionary/README.md index 93b5e83f9..235591033 100644 --- a/problems/verifying-an-alien-dictionary/README.md +++ b/problems/verifying-an-alien-dictionary/README.md @@ -14,49 +14,40 @@
In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order
. The order
of the alphabet is some permutation of lowercase letters.
Given a sequence of words
written in the alien language, and the order
of the alphabet, return true
if and only if the given words
are sorted lexicographicaly in this alien language.
- -
Example 1:
-Input: words = ["hello","leetcode"], order = "hlabcdefgijkmnopqrstuvwxyz" -Output: true -Explanation: As 'h' comes before 'l' in this language, then the sequence is sorted. +Input: words = ["hello","leetcode"], order = "hlabcdefgijkmnopqrstuvwxyz" +Output: true +Explanation: As 'h' comes before 'l' in this language, then the sequence is sorted.-
Example 2:
-Input: words = ["word","world","row"], order = "worldabcefghijkmnpqstuvxyz" -Output: false -Explanation: As 'd' comes after 'l' in this language, then words[0] > words[1], hence the sequence is unsorted. +Input: words = ["word","world","row"], order = "worldabcefghijkmnpqstuvxyz" +Output: false +Explanation: As 'd' comes after 'l' in this language, then words[0] > words[1], hence the sequence is unsorted.-
Example 3:
-Input: words = ["apple","app"], order = "abcdefghijklmnopqrstuvwxyz" -Output: false -Explanation: The first three characters "app" match, and the second string is shorter (in size.) According to lexicographical rules "apple" > "app", because 'l' > '∅', where '∅' is defined as the blank character which is less than any other character (More info). +Input: words = ["apple","app"], order = "abcdefghijklmnopqrstuvwxyz" +Output: false +Explanation: The first three characters "app" match, and the second string is shorter (in size.) According to lexicographical rules "apple" > "app", because 'l' > '∅', where '∅' is defined as the blank character which is less than any other character (More info).
+
Constraints:
-Note:
- -1 <= words.length <= 100
1 <= words[i].length <= 20
order.length == 26
words[i]
and order
are english lowercase letters.words[i]
and order
are English lowercase letters.