diff --git a/solution/0100-0199/0167.Two Sum II - Input Array Is Sorted/README_EN.md b/solution/0100-0199/0167.Two Sum II - Input Array Is Sorted/README_EN.md index 45b0058f47232..f4085cc6b610b 100644 --- a/solution/0100-0199/0167.Two Sum II - Input Array Is Sorted/README_EN.md +++ b/solution/0100-0199/0167.Two Sum II - Input Array Is Sorted/README_EN.md @@ -4,7 +4,7 @@ ## Description -

Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 < numbers.length.

+

Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 <= numbers.length.

Return the indices of the two numbers, index1 and index2, added by one as an integer array [index1, index2] of length 2.

diff --git a/solution/1100-1199/1160.Find Words That Can Be Formed by Characters/README_EN.md b/solution/1100-1199/1160.Find Words That Can Be Formed by Characters/README_EN.md index c9b9b7887af09..0c9012c53f70e 100644 --- a/solution/1100-1199/1160.Find Words That Can Be Formed by Characters/README_EN.md +++ b/solution/1100-1199/1160.Find Words That Can Be Formed by Characters/README_EN.md @@ -6,7 +6,7 @@

You are given an array of strings words and a string chars.

-

A string is good if it can be formed by characters from chars (each character can only be used once).

+

A string is good if it can be formed by characters from chars (each character can only be used once).

Return the sum of lengths of all good strings in words.

diff --git a/solution/2500-2599/2563.Count the Number of Fair Pairs/README.md b/solution/2500-2599/2563.Count the Number of Fair Pairs/README.md index 36cd9486017e0..e16d4de115741 100644 --- a/solution/2500-2599/2563.Count the Number of Fair Pairs/README.md +++ b/solution/2500-2599/2563.Count the Number of Fair Pairs/README.md @@ -30,7 +30,7 @@
 输入:nums = [1,7,9,2,5], lower = 11, upper = 11
 输出:1
-解释:只有单个公平数对:(2,3) 。
+解释:只有单个公平数对:(2,9) 。
 

 

diff --git a/solution/2600-2699/2693.Call Function with Custom Context/README_EN.md b/solution/2600-2699/2693.Call Function with Custom Context/README_EN.md index 5b7890dec324a..97c0eebb69fce 100644 --- a/solution/2600-2699/2693.Call Function with Custom Context/README_EN.md +++ b/solution/2600-2699/2693.Call Function with Custom Context/README_EN.md @@ -51,7 +51,7 @@ args = [{"item": "burger"}, 10, 1.1]

 

Constraints:

- +

 

+Follow up: Can you write an algorithm with O(log n) runtime complexity? + ## Solutions diff --git a/solution/2700-2799/2776.Convert Callback Based Function to Promise Based Function/README_EN.md b/solution/2700-2799/2776.Convert Callback Based Function to Promise Based Function/README_EN.md index fe35ce8c098ee..269e80ba8a88c 100644 --- a/solution/2700-2799/2776.Convert Callback Based Function to Promise Based Function/README_EN.md +++ b/solution/2700-2799/2776.Convert Callback Based Function to Promise Based Function/README_EN.md @@ -6,7 +6,9 @@

Write a function that accepts another function fn and converts the callback-based function into a promise-based function. 

-

The promisify function takes in a function fn that accepts a callback as its first argument and also any additional arguments. It returns a new function that returns a promise instead. The returned promise should resolve with the result of the original function when the callback is called with a successful response, and reject with the error when the callback is called with an error. The returned promise-based function should accept the additional arguments as inputs.

+

The function fn takes a callback as its first argument, along with any additional arguments args passed as separate inputs.

+ +

The promisify function returns a new function that should return a promise. The promise should resolve with the argument passed as the first parameter of the callback when the callback is invoked without error, and reject with the error when the callback is called with an error as the second argument.

The following is an example of a function that could be passed into promisify.

diff --git a/solution/2700-2799/2796.Repeat String/README_EN.md b/solution/2700-2799/2796.Repeat String/README_EN.md index 5557e88d77a17..6262e1a4d35e7 100644 --- a/solution/2700-2799/2796.Repeat String/README_EN.md +++ b/solution/2700-2799/2796.Repeat String/README_EN.md @@ -37,8 +37,7 @@

Constraints:

## Solutions diff --git a/solution/DATABASE_README.md b/solution/DATABASE_README.md index c07f1614bd397..6ee852dec4315 100644 --- a/solution/DATABASE_README.md +++ b/solution/DATABASE_README.md @@ -250,4 +250,15 @@ ## 版权 -著作权归 [GitHub 开源社区 Doocs](https://github.com/doocs) 所有,商业转载请联系 [@yanglbme](mailto:contact@yanglibin.info) 获得授权,非商业转载请注明出处。 +本项目著作权归 [GitHub 开源社区 Doocs](https://github.com/doocs) 所有,商业转载请联系 @yanglbme 获得授权,非商业转载请注明出处。 + +## 联系我们 + +欢迎各位小伙伴们添加 @yanglbme 的个人微信(微信号:YLB0109),备注 「**leetcode**」。后续我们会创建算法、技术相关的交流群,大家一起交流学习,分享经验,共同进步。 + +| | +| ------------------------------------------------------------------------------------------------------------------------------ | + +## 许可证 + +知识共享 版权归属-相同方式共享 4.0 国际 公共许可证 diff --git a/solution/DATABASE_README_EN.md b/solution/DATABASE_README_EN.md index aad41ef999334..07fb8ec7a3df1 100644 --- a/solution/DATABASE_README_EN.md +++ b/solution/DATABASE_README_EN.md @@ -248,4 +248,15 @@ Press Control + F(or Command + F on ## Copyright -[@Doocs](https://github.com/doocs) +The copyright of this project belongs to [Doocs](https://github.com/doocs) community. For commercial reprints, please contact [@yanglbme](mailto:contact@yanglibin.info) for authorization. For non-commercial reprints, please indicate the source. + +## Contact Us + +We welcome everyone to add @yanglbme's personal WeChat (WeChat ID: YLB0109), with the note "leetcode". In the future, we will create algorithm and technology related discussion groups, where we can learn and share experiences together, and make progress together. + +| | +| --------------------------------------------------------------------------------------------------------------------------------- | + +## License + +This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. diff --git a/solution/JAVASCRIPT_README.md b/solution/JAVASCRIPT_README.md index e24d9b431fc61..c95287c9c0c86 100644 --- a/solution/JAVASCRIPT_README.md +++ b/solution/JAVASCRIPT_README.md @@ -80,4 +80,15 @@ ## 版权 -著作权归 [GitHub 开源社区 Doocs](https://github.com/doocs) 所有,商业转载请联系 [@yanglbme](mailto:contact@yanglibin.info) 获得授权,非商业转载请注明出处。 +本项目著作权归 [GitHub 开源社区 Doocs](https://github.com/doocs) 所有,商业转载请联系 @yanglbme 获得授权,非商业转载请注明出处。 + +## 联系我们 + +欢迎各位小伙伴们添加 @yanglbme 的个人微信(微信号:YLB0109),备注 「**leetcode**」。后续我们会创建算法、技术相关的交流群,大家一起交流学习,分享经验,共同进步。 + +| | +| ------------------------------------------------------------------------------------------------------------------------------ | + +## 许可证 + +知识共享 版权归属-相同方式共享 4.0 国际 公共许可证 diff --git a/solution/JAVASCRIPT_README_EN.md b/solution/JAVASCRIPT_README_EN.md index 6d0c0dbc0b136..e6781d310ba50 100644 --- a/solution/JAVASCRIPT_README_EN.md +++ b/solution/JAVASCRIPT_README_EN.md @@ -78,4 +78,15 @@ Press Control + F(or Command + F on ## Copyright -[@Doocs](https://github.com/doocs) +The copyright of this project belongs to [Doocs](https://github.com/doocs) community. For commercial reprints, please contact [@yanglbme](mailto:contact@yanglibin.info) for authorization. For non-commercial reprints, please indicate the source. + +## Contact Us + +We welcome everyone to add @yanglbme's personal WeChat (WeChat ID: YLB0109), with the note "leetcode". In the future, we will create algorithm and technology related discussion groups, where we can learn and share experiences together, and make progress together. + +| | +| --------------------------------------------------------------------------------------------------------------------------------- | + +## License + +This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. diff --git a/solution/README.md b/solution/README.md index b2fd88bdf9cdb..aea51e28c1ce8 100644 --- a/solution/README.md +++ b/solution/README.md @@ -2774,7 +2774,7 @@ | 2761 | [和等于目标值的质数对](/solution/2700-2799/2761.Prime%20Pairs%20With%20Target%20Sum/README.md) | `数组`,`数学`,`枚举`,`数论` | 中等 | 第 352 场周赛 | | 2762 | [不间断子数组](/solution/2700-2799/2762.Continuous%20Subarrays/README.md) | `队列`,`数组`,`有序集合`,`滑动窗口`,`单调队列`,`堆(优先队列)` | 中等 | 第 352 场周赛 | | 2763 | [所有子数组中不平衡数字之和](/solution/2700-2799/2763.Sum%20of%20Imbalance%20Numbers%20of%20All%20Subarrays/README.md) | `数组`,`哈希表`,`有序集合` | 困难 | 第 352 场周赛 | -| 2764 | [数组是否表示某二叉树的前序遍历](/solution/2700-2799/2764.is%20Array%20a%20Preorder%20of%20Some%20%E2%80%8CBinary%20Tree/README.md) | `栈`,`树`,`深度优先搜索`,`二叉树` | 中等 | 🔒 | +| 2764 | [数组是否表示某二叉树的前序遍历](/solution/2700-2799/2764.Is%20Array%20a%20Preorder%20of%20Some%20%E2%80%8CBinary%20Tree/README.md) | `栈`,`树`,`深度优先搜索`,`二叉树` | 中等 | 🔒 | | 2765 | [最长交替子序列](/solution/2700-2799/2765.Longest%20Alternating%20Subarray/README.md) | `数组`,`枚举` | 简单 | 第 108 场双周赛 | | 2766 | [重新放置石块](/solution/2700-2799/2766.Relocate%20Marbles/README.md) | `数组`,`哈希表`,`排序`,`模拟` | 中等 | 第 108 场双周赛 | | 2767 | [将字符串分割为最少的美丽子字符串](/solution/2700-2799/2767.Partition%20String%20Into%20Minimum%20Beautiful%20Substrings/README.md) | `哈希表`,`字符串`,`动态规划`,`回溯` | 中等 | 第 108 场双周赛 | @@ -2989,8 +2989,4 @@ 欢迎各位小伙伴们添加 @yanglbme 的个人微信(微信号:YLB0109),备注 「**leetcode**」。后续我们会创建算法、技术相关的交流群,大家一起交流学习,分享经验,共同进步。 | | -| ------------------------------------------------------------------------------------------------------------------------------ | - -## 许可证 - -知识共享 版权归属-相同方式共享 4.0 国际 公共许可证 \ No newline at end of file +| ------------------------------------------------------------------------------------------------------------------------------ | \ No newline at end of file diff --git a/solution/README_EN.md b/solution/README_EN.md index 840750846244b..fbaba2fd8a2cf 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -2772,7 +2772,7 @@ Press Control + F(or Command + F on | 2761 | [Prime Pairs With Target Sum](/solution/2700-2799/2761.Prime%20Pairs%20With%20Target%20Sum/README_EN.md) | `Array`,`Math`,`Enumeration`,`Number Theory` | Medium | Weekly Contest 352 | | 2762 | [Continuous Subarrays](/solution/2700-2799/2762.Continuous%20Subarrays/README_EN.md) | `Queue`,`Array`,`Ordered Set`,`Sliding Window`,`Monotonic Queue`,`Heap (Priority Queue)` | Medium | Weekly Contest 352 | | 2763 | [Sum of Imbalance Numbers of All Subarrays](/solution/2700-2799/2763.Sum%20of%20Imbalance%20Numbers%20of%20All%20Subarrays/README_EN.md) | `Array`,`Hash Table`,`Ordered Set` | Hard | Weekly Contest 352 | -| 2764 | [is Array a Preorder of Some ‌Binary Tree](/solution/2700-2799/2764.is%20Array%20a%20Preorder%20of%20Some%20%E2%80%8CBinary%20Tree/README_EN.md) | `Stack`,`Tree`,`Depth-First Search`,`Binary Tree` | Medium | 🔒 | +| 2764 | [Is Array a Preorder of Some ‌Binary Tree](/solution/2700-2799/2764.Is%20Array%20a%20Preorder%20of%20Some%20%E2%80%8CBinary%20Tree/README_EN.md) | `Stack`,`Tree`,`Depth-First Search`,`Binary Tree` | Medium | 🔒 | | 2765 | [Longest Alternating Subarray](/solution/2700-2799/2765.Longest%20Alternating%20Subarray/README_EN.md) | `Array`,`Enumeration` | Easy | Biweekly Contest 108 | | 2766 | [Relocate Marbles](/solution/2700-2799/2766.Relocate%20Marbles/README_EN.md) | `Array`,`Hash Table`,`Sorting`,`Simulation` | Medium | Biweekly Contest 108 | | 2767 | [Partition String Into Minimum Beautiful Substrings](/solution/2700-2799/2767.Partition%20String%20Into%20Minimum%20Beautiful%20Substrings/README_EN.md) | `Hash Table`,`String`,`Dynamic Programming`,`Backtracking` | Medium | Biweekly Contest 108 | @@ -2991,4 +2991,4 @@ We welcome everyone to add @yanglbme's personal WeChat (WeChat ID: YLB0109), wit ## License -This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. +This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. \ No newline at end of file diff --git a/solution/summary.md b/solution/summary.md index c0c71264c584e..78016bbc0885b 100644 --- a/solution/summary.md +++ b/solution/summary.md @@ -2817,7 +2817,7 @@ - [2761.和等于目标值的质数对](/solution/2700-2799/2761.Prime%20Pairs%20With%20Target%20Sum/README.md) - [2762.不间断子数组](/solution/2700-2799/2762.Continuous%20Subarrays/README.md) - [2763.所有子数组中不平衡数字之和](/solution/2700-2799/2763.Sum%20of%20Imbalance%20Numbers%20of%20All%20Subarrays/README.md) - - [2764.数组是否表示某二叉树的前序遍历](/solution/2700-2799/2764.is%20Array%20a%20Preorder%20of%20Some%20%E2%80%8CBinary%20Tree/README.md) + - [2764.数组是否表示某二叉树的前序遍历](/solution/2700-2799/2764.Is%20Array%20a%20Preorder%20of%20Some%20%E2%80%8CBinary%20Tree/README.md) - [2765.最长交替子序列](/solution/2700-2799/2765.Longest%20Alternating%20Subarray/README.md) - [2766.重新放置石块](/solution/2700-2799/2766.Relocate%20Marbles/README.md) - [2767.将字符串分割为最少的美丽子字符串](/solution/2700-2799/2767.Partition%20String%20Into%20Minimum%20Beautiful%20Substrings/README.md) diff --git a/solution/summary_en.md b/solution/summary_en.md index 8ca362264e6c1..4a4cb39a6461a 100644 --- a/solution/summary_en.md +++ b/solution/summary_en.md @@ -2817,7 +2817,7 @@ - [2761.Prime Pairs With Target Sum](/solution/2700-2799/2761.Prime%20Pairs%20With%20Target%20Sum/README_EN.md) - [2762.Continuous Subarrays](/solution/2700-2799/2762.Continuous%20Subarrays/README_EN.md) - [2763.Sum of Imbalance Numbers of All Subarrays](/solution/2700-2799/2763.Sum%20of%20Imbalance%20Numbers%20of%20All%20Subarrays/README_EN.md) - - [2764.is Array a Preorder of Some ‌Binary Tree](/solution/2700-2799/2764.is%20Array%20a%20Preorder%20of%20Some%20%E2%80%8CBinary%20Tree/README_EN.md) + - [2764.Is Array a Preorder of Some ‌Binary Tree](/solution/2700-2799/2764.Is%20Array%20a%20Preorder%20of%20Some%20%E2%80%8CBinary%20Tree/README_EN.md) - [2765.Longest Alternating Subarray](/solution/2700-2799/2765.Longest%20Alternating%20Subarray/README_EN.md) - [2766.Relocate Marbles](/solution/2700-2799/2766.Relocate%20Marbles/README_EN.md) - [2767.Partition String Into Minimum Beautiful Substrings](/solution/2700-2799/2767.Partition%20String%20Into%20Minimum%20Beautiful%20Substrings/README_EN.md) diff --git a/solution/template.md b/solution/template.md index b139c1832a136..4a83ccc7df5a8 100644 --- a/solution/template.md +++ b/solution/template.md @@ -23,6 +23,10 @@ | | | ------------------------------------------------------------------------------------------------------------------------------ | +## 许可证 + +知识共享 版权归属-相同方式共享 4.0 国际 公共许可证 + ---