diff --git a/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains/README.md b/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains/README.md index 726f4d0dc6c8f..65233444de11f 100644 --- a/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains/README.md +++ b/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains/README.md +tags: + - 贪心 + - 数组 + - 数学 + - 堆(优先队列) --- @@ -24,9 +29,9 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3506.Fi

您必须确定消除所有细菌菌株所需的 最短 时间。

@@ -58,7 +63,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3506.Fi

输入:timeReq = [10,4], splitTime = 5

-

输出:5

+

输出:15

解释:

diff --git a/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains/README_EN.md b/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains/README_EN.md index f15ef72f3875e..506e72053a5d0 100644 --- a/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains/README_EN.md +++ b/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains/README_EN.md +tags: + - Greedy + - Array + - Math + - Heap (Priority Queue) --- diff --git a/solution/3500-3599/3507.Minimum Pair Removal to Sort Array I/README.md b/solution/3500-3599/3507.Minimum Pair Removal to Sort Array I/README.md index bf21ab601b9a8..fd530cf92144e 100644 --- a/solution/3500-3599/3507.Minimum Pair Removal to Sort Array I/README.md +++ b/solution/3500-3599/3507.Minimum Pair Removal to Sort Array I/README.md @@ -2,6 +2,14 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3507.Minimum%20Pair%20Removal%20to%20Sort%20Array%20I/README.md +tags: + - 数组 + - 哈希表 + - 链表 + - 双向链表 + - 有序集合 + - 模拟 + - 堆(优先队列) --- diff --git a/solution/3500-3599/3507.Minimum Pair Removal to Sort Array I/README_EN.md b/solution/3500-3599/3507.Minimum Pair Removal to Sort Array I/README_EN.md index 81dee63d6cb4a..37c9eed1351ee 100644 --- a/solution/3500-3599/3507.Minimum Pair Removal to Sort Array I/README_EN.md +++ b/solution/3500-3599/3507.Minimum Pair Removal to Sort Array I/README_EN.md @@ -2,6 +2,14 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3507.Minimum%20Pair%20Removal%20to%20Sort%20Array%20I/README_EN.md +tags: + - Array + - Hash Table + - Linked List + - Doubly-Linked List + - Ordered Set + - Simulation + - Heap (Priority Queue) --- diff --git a/solution/3500-3599/3508.Implement Router/README.md b/solution/3500-3599/3508.Implement Router/README.md index 20e6dcae91eea..883b13f3bf6ae 100644 --- a/solution/3500-3599/3508.Implement Router/README.md +++ b/solution/3500-3599/3508.Implement Router/README.md @@ -2,6 +2,13 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3508.Implement%20Router/README.md +tags: + - 设计 + - 队列 + - 数组 + - 哈希表 + - 二分查找 + - 有序集合 --- diff --git a/solution/3500-3599/3508.Implement Router/README_EN.md b/solution/3500-3599/3508.Implement Router/README_EN.md index 78aa429a92329..0e00e4556d762 100644 --- a/solution/3500-3599/3508.Implement Router/README_EN.md +++ b/solution/3500-3599/3508.Implement Router/README_EN.md @@ -2,6 +2,13 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3508.Implement%20Router/README_EN.md +tags: + - Design + - Queue + - Array + - Hash Table + - Binary Search + - Ordered Set --- diff --git a/solution/3500-3599/3509.Maximum Product of Subsequences With an Alternating Sum Equal to K/README.md b/solution/3500-3599/3509.Maximum Product of Subsequences With an Alternating Sum Equal to K/README.md index a6477f2b58385..d31c1cd504931 100644 --- a/solution/3500-3599/3509.Maximum Product of Subsequences With an Alternating Sum Equal to K/README.md +++ b/solution/3500-3599/3509.Maximum Product of Subsequences With an Alternating Sum Equal to K/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3509.Maximum%20Product%20of%20Subsequences%20With%20an%20Alternating%20Sum%20Equal%20to%20K/README.md +tags: + - 数组 + - 哈希表 + - 动态规划 --- diff --git a/solution/3500-3599/3509.Maximum Product of Subsequences With an Alternating Sum Equal to K/README_EN.md b/solution/3500-3599/3509.Maximum Product of Subsequences With an Alternating Sum Equal to K/README_EN.md index 86a838b97d445..992c08b18c475 100644 --- a/solution/3500-3599/3509.Maximum Product of Subsequences With an Alternating Sum Equal to K/README_EN.md +++ b/solution/3500-3599/3509.Maximum Product of Subsequences With an Alternating Sum Equal to K/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3509.Maximum%20Product%20of%20Subsequences%20With%20an%20Alternating%20Sum%20Equal%20to%20K/README_EN.md +tags: + - Array + - Hash Table + - Dynamic Programming --- diff --git a/solution/3500-3599/3512.Minimum Operations to Make Array Sum Divisible by K/README.md b/solution/3500-3599/3512.Minimum Operations to Make Array Sum Divisible by K/README.md index 477593cc7a52a..24eaaa5886a18 100644 --- a/solution/3500-3599/3512.Minimum Operations to Make Array Sum Divisible by K/README.md +++ b/solution/3500-3599/3512.Minimum Operations to Make Array Sum Divisible by K/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3512.Minimum%20Operations%20to%20Make%20Array%20Sum%20Divisible%20by%20K/README.md +tags: + - 数组 + - 数学 --- diff --git a/solution/3500-3599/3512.Minimum Operations to Make Array Sum Divisible by K/README_EN.md b/solution/3500-3599/3512.Minimum Operations to Make Array Sum Divisible by K/README_EN.md index e4adb8d98a3e9..6402962ce2ac4 100644 --- a/solution/3500-3599/3512.Minimum Operations to Make Array Sum Divisible by K/README_EN.md +++ b/solution/3500-3599/3512.Minimum Operations to Make Array Sum Divisible by K/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3512.Minimum%20Operations%20to%20Make%20Array%20Sum%20Divisible%20by%20K/README_EN.md +tags: + - Array + - Math --- diff --git a/solution/3500-3599/3513.Number of Unique XOR Triplets I/README.md b/solution/3500-3599/3513.Number of Unique XOR Triplets I/README.md index 5b28cded68e9b..3c524aa263489 100644 --- a/solution/3500-3599/3513.Number of Unique XOR Triplets I/README.md +++ b/solution/3500-3599/3513.Number of Unique XOR Triplets I/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3513.Number%20of%20Unique%20XOR%20Triplets%20I/README.md +tags: + - 位运算 + - 数组 + - 数学 --- diff --git a/solution/3500-3599/3513.Number of Unique XOR Triplets I/README_EN.md b/solution/3500-3599/3513.Number of Unique XOR Triplets I/README_EN.md index b0b4ae21dd5c9..a53461c41049b 100644 --- a/solution/3500-3599/3513.Number of Unique XOR Triplets I/README_EN.md +++ b/solution/3500-3599/3513.Number of Unique XOR Triplets I/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3513.Number%20of%20Unique%20XOR%20Triplets%20I/README_EN.md +tags: + - Bit Manipulation + - Array + - Math --- diff --git a/solution/3500-3599/3514.Number of Unique XOR Triplets II/README.md b/solution/3500-3599/3514.Number of Unique XOR Triplets II/README.md index a46859fdf3297..bc023472db15b 100644 --- a/solution/3500-3599/3514.Number of Unique XOR Triplets II/README.md +++ b/solution/3500-3599/3514.Number of Unique XOR Triplets II/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3514.Number%20of%20Unique%20XOR%20Triplets%20II/README.md +tags: + - 位运算 + - 数组 + - 数学 + - 枚举 --- diff --git a/solution/3500-3599/3514.Number of Unique XOR Triplets II/README_EN.md b/solution/3500-3599/3514.Number of Unique XOR Triplets II/README_EN.md index 6e0ecb8588db6..4efa733aed262 100644 --- a/solution/3500-3599/3514.Number of Unique XOR Triplets II/README_EN.md +++ b/solution/3500-3599/3514.Number of Unique XOR Triplets II/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3514.Number%20of%20Unique%20XOR%20Triplets%20II/README_EN.md +tags: + - Bit Manipulation + - Array + - Math + - Enumeration --- diff --git a/solution/3500-3599/3515.Shortest Path in a Weighted Tree/README.md b/solution/3500-3599/3515.Shortest Path in a Weighted Tree/README.md index 1f92729019265..1d5abb7ed388b 100644 --- a/solution/3500-3599/3515.Shortest Path in a Weighted Tree/README.md +++ b/solution/3500-3599/3515.Shortest Path in a Weighted Tree/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3515.Shortest%20Path%20in%20a%20Weighted%20Tree/README.md +tags: + - 树 + - 深度优先搜索 + - 树状数组 + - 线段树 + - 数组 --- diff --git a/solution/3500-3599/3515.Shortest Path in a Weighted Tree/README_EN.md b/solution/3500-3599/3515.Shortest Path in a Weighted Tree/README_EN.md index 61cb5faf270c8..4ee7d80de5e7e 100644 --- a/solution/3500-3599/3515.Shortest Path in a Weighted Tree/README_EN.md +++ b/solution/3500-3599/3515.Shortest Path in a Weighted Tree/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3515.Shortest%20Path%20in%20a%20Weighted%20Tree/README_EN.md +tags: + - Tree + - Depth-First Search + - Binary Indexed Tree + - Segment Tree + - Array --- diff --git a/solution/3500-3599/3516.Find Closest Person/README.md b/solution/3500-3599/3516.Find Closest Person/README.md index cb8fba908dd59..b71837a7a1e1f 100644 --- a/solution/3500-3599/3516.Find Closest Person/README.md +++ b/solution/3500-3599/3516.Find Closest Person/README.md @@ -2,6 +2,8 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3516.Find%20Closest%20Person/README.md +tags: + - 数学 --- diff --git a/solution/3500-3599/3516.Find Closest Person/README_EN.md b/solution/3500-3599/3516.Find Closest Person/README_EN.md index f35e386b31fa2..d283978a8f1e9 100644 --- a/solution/3500-3599/3516.Find Closest Person/README_EN.md +++ b/solution/3500-3599/3516.Find Closest Person/README_EN.md @@ -2,6 +2,8 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3516.Find%20Closest%20Person/README_EN.md +tags: + - Math --- diff --git a/solution/3500-3599/3517.Smallest Palindromic Rearrangement I/README.md b/solution/3500-3599/3517.Smallest Palindromic Rearrangement I/README.md index 8640bb78020a9..bb9ecb6c9503d 100644 --- a/solution/3500-3599/3517.Smallest Palindromic Rearrangement I/README.md +++ b/solution/3500-3599/3517.Smallest Palindromic Rearrangement I/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3517.Smallest%20Palindromic%20Rearrangement%20I/README.md +tags: + - 字符串 + - 计数排序 + - 排序 --- diff --git a/solution/3500-3599/3517.Smallest Palindromic Rearrangement I/README_EN.md b/solution/3500-3599/3517.Smallest Palindromic Rearrangement I/README_EN.md index 5819a029babf5..63c46b6a547cb 100644 --- a/solution/3500-3599/3517.Smallest Palindromic Rearrangement I/README_EN.md +++ b/solution/3500-3599/3517.Smallest Palindromic Rearrangement I/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3517.Smallest%20Palindromic%20Rearrangement%20I/README_EN.md +tags: + - String + - Counting Sort + - Sorting --- diff --git a/solution/3500-3599/3518.Smallest Palindromic Rearrangement II/README.md b/solution/3500-3599/3518.Smallest Palindromic Rearrangement II/README.md index ad4f85d277275..39e121fea8b3c 100644 --- a/solution/3500-3599/3518.Smallest Palindromic Rearrangement II/README.md +++ b/solution/3500-3599/3518.Smallest Palindromic Rearrangement II/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3518.Smallest%20Palindromic%20Rearrangement%20II/README.md +tags: + - 哈希表 + - 数学 + - 字符串 + - 组合数学 + - 计数 --- diff --git a/solution/3500-3599/3518.Smallest Palindromic Rearrangement II/README_EN.md b/solution/3500-3599/3518.Smallest Palindromic Rearrangement II/README_EN.md index 819f2917f2403..0f53ad76c524b 100644 --- a/solution/3500-3599/3518.Smallest Palindromic Rearrangement II/README_EN.md +++ b/solution/3500-3599/3518.Smallest Palindromic Rearrangement II/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3518.Smallest%20Palindromic%20Rearrangement%20II/README_EN.md +tags: + - Hash Table + - Math + - String + - Combinatorics + - Counting --- diff --git a/solution/3500-3599/3519.Count Numbers with Non-Decreasing Digits/README.md b/solution/3500-3599/3519.Count Numbers with Non-Decreasing Digits/README.md index 66bd25fcfd96f..058eb535d1e6c 100644 --- a/solution/3500-3599/3519.Count Numbers with Non-Decreasing Digits/README.md +++ b/solution/3500-3599/3519.Count Numbers with Non-Decreasing Digits/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3519.Count%20Numbers%20with%20Non-Decreasing%20Digits/README.md +tags: + - 数学 + - 字符串 + - 动态规划 --- diff --git a/solution/3500-3599/3519.Count Numbers with Non-Decreasing Digits/README_EN.md b/solution/3500-3599/3519.Count Numbers with Non-Decreasing Digits/README_EN.md index 130e109f581e1..c4faa3d92f11a 100644 --- a/solution/3500-3599/3519.Count Numbers with Non-Decreasing Digits/README_EN.md +++ b/solution/3500-3599/3519.Count Numbers with Non-Decreasing Digits/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3519.Count%20Numbers%20with%20Non-Decreasing%20Digits/README_EN.md +tags: + - Math + - String + - Dynamic Programming --- diff --git a/solution/3500-3599/3520.Minimum Threshold for Inversion Pairs Count/README.md b/solution/3500-3599/3520.Minimum Threshold for Inversion Pairs Count/README.md new file mode 100644 index 0000000000000..34dd950504cfd --- /dev/null +++ b/solution/3500-3599/3520.Minimum Threshold for Inversion Pairs Count/README.md @@ -0,0 +1,129 @@ +--- +comments: true +difficulty: 中等 +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3520.Minimum%20Threshold%20for%20Inversion%20Pairs%20Count/README.md +--- + + + +# [3520. 逆序对计数的最小阈值 🔒](https://leetcode.cn/problems/minimum-threshold-for-inversion-pairs-count) + +[English Version](/solution/3500-3599/3520.Minimum%20Threshold%20for%20Inversion%20Pairs%20Count/README_EN.md) + +## 题目描述 + + + +

给定一个整数数组 nums 和一个整数 k

+ +

阈值 为 x 的逆序对是一对下标 (i, j) 满足:

+ + + +

你的任务是确定最小的整数 min_threshold,使得 至少k 个逆序对的阈值是 min_threshold

+ +

如果没有这样的整数,返回 -1

+ +

 

+ +

示例 1:

+ +
+

输入:nums = [1,2,3,4,3,2,1], k = 7

+ +

输出:2

+ +

解释:

+ +

对于阈值 x = 2,逆序对有:

+ +
    +
  1. (3, 4) 其中 nums[3] == 4nums[4] == 3.
  2. +
  3. (2, 5) 其中 nums[2] == 3nums[5] == 2.
  4. +
  5. (3, 5) 其中 nums[3] == 4nums[5] == 2.
  6. +
  7. (4, 5) 其中 nums[4] == 3nums[5] == 2.
  8. +
  9. (1, 6) 其中 nums[1] == 2nums[6] == 1.
  10. +
  11. (2, 6) 其中 nums[2] == 3nums[6] == 1.
  12. +
  13. (4, 6) 其中 nums[4] == 3nums[6] == 1.
  14. +
  15. (5, 6) 其中 nums[5] == 2nums[6] == 1.
  16. +
+ +

如果我们选择小于 2 的任意整数作为阈值,则逆序对的数量少于 k

+
+ +

示例 2:

+ +
+

输入:nums = [10,9,9,9,1], k = 4

+ +

输出:8

+ +

解释:

+ +

对于阈值 x = 8,逆序对有:

+ +
    +
  1. (0, 1) 其中 nums[0] == 10 和 nums[1] == 9
  2. +
  3. (0, 2) 其中 nums[0] == 10nums[2] == 9
  4. +
  5. (0, 3) 其中 nums[0] == 10nums[3] == 9
  6. +
  7. (1, 4) 其中 nums[1] == 9nums[4] == 1
  8. +
  9. (2, 4) 其中 nums[2] == 9nums[4] == 1
  10. +
  11. (3, 4) 其中 nums[3] == 9nums[4] == 1
  12. +
+ +

如果我们选择小于 8 的任意整数作为阈值,则逆序对的数量少于 k

+
+ +

 

+ +

提示:

+ + + + + +## 解法 + + + +### 方法一 + + + +#### Python3 + +```python + +``` + +#### Java + +```java + +``` + +#### C++ + +```cpp + +``` + +#### Go + +```go + +``` + + + + + + diff --git a/solution/3500-3599/3520.Minimum Threshold for Inversion Pairs Count/README_EN.md b/solution/3500-3599/3520.Minimum Threshold for Inversion Pairs Count/README_EN.md new file mode 100644 index 0000000000000..7bb37a9d78ecd --- /dev/null +++ b/solution/3500-3599/3520.Minimum Threshold for Inversion Pairs Count/README_EN.md @@ -0,0 +1,127 @@ +--- +comments: true +difficulty: Medium +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3520.Minimum%20Threshold%20for%20Inversion%20Pairs%20Count/README_EN.md +--- + + + +# [3520. Minimum Threshold for Inversion Pairs Count 🔒](https://leetcode.com/problems/minimum-threshold-for-inversion-pairs-count) + +[中文文档](/solution/3500-3599/3520.Minimum%20Threshold%20for%20Inversion%20Pairs%20Count/README.md) + +## Description + + + +

You are given an array of integers nums and an integer k.

+ +

An inversion pair with a threshold x is defined as a pair of indices (i, j) such that:

+ + + +

Your task is to determine the minimum integer min_threshold such that there are at least k inversion pairs with threshold min_threshold.

+ +

If no such integer exists, return -1.

+ +

 

+

Example 1:

+ +
+

Input: nums = [1,2,3,4,3,2,1], k = 7

+ +

Output: 2

+ +

Explanation:

+ +

For threshold x = 2, the pairs are:

+ +
    +
  1. (3, 4) where nums[3] == 4 and nums[4] == 3.
  2. +
  3. (2, 5) where nums[2] == 3 and nums[5] == 2.
  4. +
  5. (3, 5) where nums[3] == 4 and nums[5] == 2.
  6. +
  7. (4, 5) where nums[4] == 3 and nums[5] == 2.
  8. +
  9. (1, 6) where nums[1] == 2 and nums[6] == 1.
  10. +
  11. (2, 6) where nums[2] == 3 and nums[6] == 1.
  12. +
  13. (4, 6) where nums[4] == 3 and nums[6] == 1.
  14. +
  15. (5, 6) where nums[5] == 2 and nums[6] == 1.
  16. +
+ +

There are less than k inversion pairs if we choose any integer less than 2 as threshold.

+
+ +

Example 2:

+ +
+

Input: nums = [10,9,9,9,1], k = 4

+ +

Output: 8

+ +

Explanation:

+ +

For threshold x = 8, the pairs are:

+ +
    +
  1. (0, 1) where nums[0] == 10 and nums[1] == 9.
  2. +
  3. (0, 2) where nums[0] == 10 and nums[2] == 9.
  4. +
  5. (0, 3) where nums[0] == 10 and nums[3] == 9.
  6. +
  7. (1, 4) where nums[1] == 9 and nums[4] == 1.
  8. +
  9. (2, 4) where nums[2] == 9 and nums[4] == 1.
  10. +
  11. (3, 4) where nums[3] == 9 and nums[4] == 1.
  12. +
+ +

There are less than k inversion pairs if we choose any integer less than 8 as threshold.

+
+ +

 

+

Constraints:

+ + + + + +## Solutions + + + +### Solution 1 + + + +#### Python3 + +```python + +``` + +#### Java + +```java + +``` + +#### C++ + +```cpp + +``` + +#### Go + +```go + +``` + + + + + + diff --git a/solution/3500-3599/3521.Find Product Recommendation Pairs/README.md b/solution/3500-3599/3521.Find Product Recommendation Pairs/README.md new file mode 100644 index 0000000000000..2073f48c0d4be --- /dev/null +++ b/solution/3500-3599/3521.Find Product Recommendation Pairs/README.md @@ -0,0 +1,168 @@ +--- +comments: true +difficulty: 中等 +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3521.Find%20Product%20Recommendation%20Pairs/README.md +tags: + - 数据库 +--- + + + +# [3521. 查找推荐产品对](https://leetcode.cn/problems/find-product-recommendation-pairs) + +[English Version](/solution/3500-3599/3521.Find%20Product%20Recommendation%20Pairs/README_EN.md) + +## 题目描述 + + + +

表:ProductPurchases

+ +
++-------------+------+
+| Column Name | Type | 
++-------------+------+
+| user_id     | int  |
+| product_id  | int  |
+| quantity    | int  |
++-------------+------+
+(user_id, product_id) 是这张表的唯一主键。
+每一行代表用户以特定数量购买的产品。
+
+ +

表:ProductInfo

+ +
++-------------+---------+
+| Column Name | Type    | 
++-------------+---------+
+| product_id  | int     |
+| category    | varchar |
+| price       | decimal |
++-------------+---------+
+product_id 是这张表的唯一主键。
+每一行表示一个产品的类别和价格。
+
+ +

亚马逊希望根据 共同购买模式 实现 “购买此商品的用户还购买了...” 功能。编写一个解决方案以实现:

+ +
    +
  1. 识别 被同一客户一起频繁购买的 不同 产品对(其中 product1_id < product2_id
  2. +
  3. 对于 每个产品对,确定有多少客户购买了这两种产品
  4. +
+ +

如果 至少有 3 位不同的 客户同时购买了这两种产品,则认为该 产品对 适合推荐。

+ +

返回结果表以 customer_count  降序 排序,并且为了避免排序持平,以 product1_id 升序 排序,并以 product2_id 升序 排序。

+ +

结果格式如下所示。

+ +

 

+ +

示例:

+ +
+

输入:

+ +

ProductPurchases 表:

+ +
++---------+------------+----------+
+| user_id | product_id | quantity |
++---------+------------+----------+
+| 1       | 101        | 2        |
+| 1       | 102        | 1        |
+| 1       | 103        | 3        |
+| 2       | 101        | 1        |
+| 2       | 102        | 5        |
+| 2       | 104        | 1        |
+| 3       | 101        | 2        |
+| 3       | 103        | 1        |
+| 3       | 105        | 4        |
+| 4       | 101        | 1        |
+| 4       | 102        | 1        |
+| 4       | 103        | 2        |
+| 4       | 104        | 3        |
+| 5       | 102        | 2        |
+| 5       | 104        | 1        |
++---------+------------+----------+
+
+ +

ProductInfo 表:

+ +
++------------+-------------+-------+
+| product_id | category    | price |
++------------+-------------+-------+
+| 101        | Electronics | 100   |
+| 102        | Books       | 20    |
+| 103        | Clothing    | 35    |
+| 104        | Kitchen     | 50    |
+| 105        | Sports      | 75    |
++------------+-------------+-------+
+
+ +

输出:

+ +
++-------------+-------------+-------------------+-------------------+----------------+
+| product1_id | product2_id | product1_category | product2_category | customer_count |
++-------------+-------------+-------------------+-------------------+----------------+
+| 101         | 102         | Electronics       | Books             | 3              |
+| 101         | 103         | Electronics       | Clothing          | 3              |
+| 102         | 104         | Books             | Kitchen           | 3              |
++-------------+-------------+-------------------+-------------------+----------------+
+
+ +

解释:

+ + + +

结果以 customer_count 降序排序。对于有相同 customer_count 的产品对,将它们以 product1_id 升序排序,然后以 product2_id 升序排序。

+
+ + + +## 解法 + + + +### 方法一 + + + +#### MySQL + +```sql + +``` + + + + + + diff --git a/solution/3500-3599/3521.Find Product Recommendation Pairs/README_EN.md b/solution/3500-3599/3521.Find Product Recommendation Pairs/README_EN.md new file mode 100644 index 0000000000000..5573455b5613b --- /dev/null +++ b/solution/3500-3599/3521.Find Product Recommendation Pairs/README_EN.md @@ -0,0 +1,167 @@ +--- +comments: true +difficulty: Medium +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3521.Find%20Product%20Recommendation%20Pairs/README_EN.md +tags: + - Database +--- + + + +# [3521. Find Product Recommendation Pairs](https://leetcode.com/problems/find-product-recommendation-pairs) + +[中文文档](/solution/3500-3599/3521.Find%20Product%20Recommendation%20Pairs/README.md) + +## Description + + + +

Table: ProductPurchases

+ +
++-------------+------+
+| Column Name | Type | 
++-------------+------+
+| user_id     | int  |
+| product_id  | int  |
+| quantity    | int  |
++-------------+------+
+(user_id, product_id) is the unique key for this table.
+Each row represents a purchase of a product by a user in a specific quantity.
+
+ +

Table: ProductInfo

+ +
++-------------+---------+
+| Column Name | Type    | 
++-------------+---------+
+| product_id  | int     |
+| category    | varchar |
+| price       | decimal |
++-------------+---------+
+product_id is the primary key for this table.
+Each row assigns a category and price to a product.
+
+ +

Amazon wants to implement the Customers who bought this also bought... feature based on co-purchase patterns. Write a solution to :

+ +
    +
  1. Identify distinct product pairs frequently purchased together by the same customers (where product1_id < product2_id)
  2. +
  3. For each product pair, determine how many customers purchased both products
  4. +
+ +

A product pair is considered for recommendation if at least 3 different customers have purchased both products.

+ +

Return the result table ordered by customer_count in descending order, and in case of a tie, by product1_id in ascending order, and then by product2_id in ascending order.

+ +

The result format is in the following example.

+ +

 

+

Example:

+ +
+

Input:

+ +

ProductPurchases table:

+ +
++---------+------------+----------+
+| user_id | product_id | quantity |
++---------+------------+----------+
+| 1       | 101        | 2        |
+| 1       | 102        | 1        |
+| 1       | 103        | 3        |
+| 2       | 101        | 1        |
+| 2       | 102        | 5        |
+| 2       | 104        | 1        |
+| 3       | 101        | 2        |
+| 3       | 103        | 1        |
+| 3       | 105        | 4        |
+| 4       | 101        | 1        |
+| 4       | 102        | 1        |
+| 4       | 103        | 2        |
+| 4       | 104        | 3        |
+| 5       | 102        | 2        |
+| 5       | 104        | 1        |
++---------+------------+----------+
+
+ +

ProductInfo table:

+ +
++------------+-------------+-------+
+| product_id | category    | price |
++------------+-------------+-------+
+| 101        | Electronics | 100   |
+| 102        | Books       | 20    |
+| 103        | Clothing    | 35    |
+| 104        | Kitchen     | 50    |
+| 105        | Sports      | 75    |
++------------+-------------+-------+
+
+ +

Output:

+ +
++-------------+-------------+-------------------+-------------------+----------------+
+| product1_id | product2_id | product1_category | product2_category | customer_count |
++-------------+-------------+-------------------+-------------------+----------------+
+| 101         | 102         | Electronics       | Books             | 3              |
+| 101         | 103         | Electronics       | Clothing          | 3              |
+| 102         | 104         | Books             | Kitchen           | 3              |
++-------------+-------------+-------------------+-------------------+----------------+
+
+ +

Explanation:

+ + + +

The result is ordered by customer_count in descending order. For pairs with the same customer_count, they are ordered by product1_id and then product2_id in ascending order.

+
+ + + +## Solutions + + + +### Solution 1 + + + +#### MySQL + +```sql + +``` + + + + + + diff --git a/solution/DATABASE_README.md b/solution/DATABASE_README.md index 17971ff7c3144..d4cc2f4132a7c 100644 --- a/solution/DATABASE_README.md +++ b/solution/DATABASE_README.md @@ -314,6 +314,7 @@ | 3475 | [DNA 模式识别](/solution/3400-3499/3475.DNA%20Pattern%20Recognition/README.md) | | 中等 | | | 3482 | [分析组织层级](/solution/3400-3499/3482.Analyze%20Organization%20Hierarchy/README.md) | `数据库` | 困难 | | | 3497 | [分析订阅转化](/solution/3400-3499/3497.Analyze%20Subscription%20Conversion/README.md) | `数据库` | 中等 | | +| 3521 | [查找推荐产品对](/solution/3500-3599/3521.Find%20Product%20Recommendation%20Pairs/README.md) | | 中等 | | ## 版权 diff --git a/solution/DATABASE_README_EN.md b/solution/DATABASE_README_EN.md index cb0d4ea59039c..75ce518efe2b4 100644 --- a/solution/DATABASE_README_EN.md +++ b/solution/DATABASE_README_EN.md @@ -312,6 +312,7 @@ Press Control + F(or Command + F on | 3475 | [DNA Pattern Recognition](/solution/3400-3499/3475.DNA%20Pattern%20Recognition/README_EN.md) | | Medium | | | 3482 | [Analyze Organization Hierarchy](/solution/3400-3499/3482.Analyze%20Organization%20Hierarchy/README_EN.md) | `Database` | Hard | | | 3497 | [Analyze Subscription Conversion](/solution/3400-3499/3497.Analyze%20Subscription%20Conversion/README_EN.md) | `Database` | Medium | | +| 3521 | [Find Product Recommendation Pairs](/solution/3500-3599/3521.Find%20Product%20Recommendation%20Pairs/README_EN.md) | | Medium | | ## Copyright diff --git a/solution/README.md b/solution/README.md index eaf998b0bd8e0..eef9a585a0688 100644 --- a/solution/README.md +++ b/solution/README.md @@ -3517,20 +3517,22 @@ | 3504 | [子字符串连接后的最长回文串 II](/solution/3500-3599/3504.Longest%20Palindrome%20After%20Substring%20Concatenation%20II/README.md) | `双指针`,`字符串`,`动态规划` | 困难 | 第 443 场周赛 | | 3505 | [使 K 个子数组内元素相等的最少操作数](/solution/3500-3599/3505.Minimum%20Operations%20to%20Make%20Elements%20Within%20K%20Subarrays%20Equal/README.md) | `数组`,`哈希表`,`数学`,`动态规划`,`滑动窗口`,`堆(优先队列)` | 困难 | 第 443 场周赛 | | 3506 | [Find Time Required to Eliminate Bacterial Strains II](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains%20II/README.md) | | 困难 | 🔒 | -| 3506 | [查找消除细菌菌株所需时间](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains/README.md) | | 困难 | 🔒 | -| 3507 | [移除最小数对使数组有序 I](/solution/3500-3599/3507.Minimum%20Pair%20Removal%20to%20Sort%20Array%20I/README.md) | | 简单 | 第 444 场周赛 | -| 3508 | [设计路由器](/solution/3500-3599/3508.Implement%20Router/README.md) | | 中等 | 第 444 场周赛 | -| 3509 | [最大化交错和为 K 的子序列乘积](/solution/3500-3599/3509.Maximum%20Product%20of%20Subsequences%20With%20an%20Alternating%20Sum%20Equal%20to%20K/README.md) | | 困难 | 第 444 场周赛 | +| 3506 | [查找消除细菌菌株所需时间](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains/README.md) | `贪心`,`数组`,`数学`,`堆(优先队列)` | 困难 | 🔒 | +| 3507 | [移除最小数对使数组有序 I](/solution/3500-3599/3507.Minimum%20Pair%20Removal%20to%20Sort%20Array%20I/README.md) | `数组`,`哈希表`,`链表`,`双向链表`,`有序集合`,`模拟`,`堆(优先队列)` | 简单 | 第 444 场周赛 | +| 3508 | [设计路由器](/solution/3500-3599/3508.Implement%20Router/README.md) | `设计`,`队列`,`数组`,`哈希表`,`二分查找`,`有序集合` | 中等 | 第 444 场周赛 | +| 3509 | [最大化交错和为 K 的子序列乘积](/solution/3500-3599/3509.Maximum%20Product%20of%20Subsequences%20With%20an%20Alternating%20Sum%20Equal%20to%20K/README.md) | `数组`,`哈希表`,`动态规划` | 困难 | 第 444 场周赛 | | 3510 | [移除最小数对使数组有序 II](/solution/3500-3599/3510.Minimum%20Pair%20Removal%20to%20Sort%20Array%20II/README.md) | `数组`,`哈希表`,`链表`,`双向链表`,`有序集合`,`模拟`,`堆(优先队列)` | 困难 | 第 444 场周赛 | | 3511 | [构造正数组](/solution/3500-3599/3511.Make%20a%20Positive%20Array/README.md) | `贪心`,`数组`,`前缀和` | 中等 | 🔒 | -| 3512 | [使数组和能被 K 整除的最少操作次数](/solution/3500-3599/3512.Minimum%20Operations%20to%20Make%20Array%20Sum%20Divisible%20by%20K/README.md) | | 简单 | 第 154 场双周赛 | -| 3513 | [不同 XOR 三元组的数目 I](/solution/3500-3599/3513.Number%20of%20Unique%20XOR%20Triplets%20I/README.md) | | 中等 | 第 154 场双周赛 | -| 3514 | [不同 XOR 三元组的数目 II](/solution/3500-3599/3514.Number%20of%20Unique%20XOR%20Triplets%20II/README.md) | | 中等 | 第 154 场双周赛 | -| 3515 | [带权树中的最短路径](/solution/3500-3599/3515.Shortest%20Path%20in%20a%20Weighted%20Tree/README.md) | | 困难 | 第 154 场双周赛 | -| 3516 | [找到最近的人](/solution/3500-3599/3516.Find%20Closest%20Person/README.md) | | 简单 | 第 445 场周赛 | -| 3517 | [最小回文排列 I](/solution/3500-3599/3517.Smallest%20Palindromic%20Rearrangement%20I/README.md) | | 中等 | 第 445 场周赛 | -| 3518 | [最小回文排列 II](/solution/3500-3599/3518.Smallest%20Palindromic%20Rearrangement%20II/README.md) | | 困难 | 第 445 场周赛 | -| 3519 | [统计逐位非递减的整数](/solution/3500-3599/3519.Count%20Numbers%20with%20Non-Decreasing%20Digits/README.md) | | 困难 | 第 445 场周赛 | +| 3512 | [使数组和能被 K 整除的最少操作次数](/solution/3500-3599/3512.Minimum%20Operations%20to%20Make%20Array%20Sum%20Divisible%20by%20K/README.md) | `数组`,`数学` | 简单 | 第 154 场双周赛 | +| 3513 | [不同 XOR 三元组的数目 I](/solution/3500-3599/3513.Number%20of%20Unique%20XOR%20Triplets%20I/README.md) | `位运算`,`数组`,`数学` | 中等 | 第 154 场双周赛 | +| 3514 | [不同 XOR 三元组的数目 II](/solution/3500-3599/3514.Number%20of%20Unique%20XOR%20Triplets%20II/README.md) | `位运算`,`数组`,`数学`,`枚举` | 中等 | 第 154 场双周赛 | +| 3515 | [带权树中的最短路径](/solution/3500-3599/3515.Shortest%20Path%20in%20a%20Weighted%20Tree/README.md) | `树`,`深度优先搜索`,`树状数组`,`线段树`,`数组` | 困难 | 第 154 场双周赛 | +| 3516 | [找到最近的人](/solution/3500-3599/3516.Find%20Closest%20Person/README.md) | `数学` | 简单 | 第 445 场周赛 | +| 3517 | [最小回文排列 I](/solution/3500-3599/3517.Smallest%20Palindromic%20Rearrangement%20I/README.md) | `字符串`,`计数排序`,`排序` | 中等 | 第 445 场周赛 | +| 3518 | [最小回文排列 II](/solution/3500-3599/3518.Smallest%20Palindromic%20Rearrangement%20II/README.md) | `哈希表`,`数学`,`字符串`,`组合数学`,`计数` | 困难 | 第 445 场周赛 | +| 3519 | [统计逐位非递减的整数](/solution/3500-3599/3519.Count%20Numbers%20with%20Non-Decreasing%20Digits/README.md) | `数学`,`字符串`,`动态规划` | 困难 | 第 445 场周赛 | +| 3520 | [逆序对计数的最小阈值](/solution/3500-3599/3520.Minimum%20Threshold%20for%20Inversion%20Pairs%20Count/README.md) | | 中等 | 🔒 | +| 3521 | [查找推荐产品对](/solution/3500-3599/3521.Find%20Product%20Recommendation%20Pairs/README.md) | | 中等 | | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index f90ed0a56a996..58c7737c98931 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -3515,20 +3515,22 @@ Press Control + F(or Command + F on | 3504 | [Longest Palindrome After Substring Concatenation II](/solution/3500-3599/3504.Longest%20Palindrome%20After%20Substring%20Concatenation%20II/README_EN.md) | `Two Pointers`,`String`,`Dynamic Programming` | Hard | Weekly Contest 443 | | 3505 | [Minimum Operations to Make Elements Within K Subarrays Equal](/solution/3500-3599/3505.Minimum%20Operations%20to%20Make%20Elements%20Within%20K%20Subarrays%20Equal/README_EN.md) | `Array`,`Hash Table`,`Math`,`Dynamic Programming`,`Sliding Window`,`Heap (Priority Queue)` | Hard | Weekly Contest 443 | | 3506 | [Find Time Required to Eliminate Bacterial Strains II](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains%20II/README_EN.md) | | Hard | 🔒 | -| 3506 | [Find Time Required to Eliminate Bacterial Strains](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains/README_EN.md) | | Hard | 🔒 | -| 3507 | [Minimum Pair Removal to Sort Array I](/solution/3500-3599/3507.Minimum%20Pair%20Removal%20to%20Sort%20Array%20I/README_EN.md) | | Easy | Weekly Contest 444 | -| 3508 | [Implement Router](/solution/3500-3599/3508.Implement%20Router/README_EN.md) | | Medium | Weekly Contest 444 | -| 3509 | [Maximum Product of Subsequences With an Alternating Sum Equal to K](/solution/3500-3599/3509.Maximum%20Product%20of%20Subsequences%20With%20an%20Alternating%20Sum%20Equal%20to%20K/README_EN.md) | | Hard | Weekly Contest 444 | +| 3506 | [Find Time Required to Eliminate Bacterial Strains](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains/README_EN.md) | `Greedy`,`Array`,`Math`,`Heap (Priority Queue)` | Hard | 🔒 | +| 3507 | [Minimum Pair Removal to Sort Array I](/solution/3500-3599/3507.Minimum%20Pair%20Removal%20to%20Sort%20Array%20I/README_EN.md) | `Array`,`Hash Table`,`Linked List`,`Doubly-Linked List`,`Ordered Set`,`Simulation`,`Heap (Priority Queue)` | Easy | Weekly Contest 444 | +| 3508 | [Implement Router](/solution/3500-3599/3508.Implement%20Router/README_EN.md) | `Design`,`Queue`,`Array`,`Hash Table`,`Binary Search`,`Ordered Set` | Medium | Weekly Contest 444 | +| 3509 | [Maximum Product of Subsequences With an Alternating Sum Equal to K](/solution/3500-3599/3509.Maximum%20Product%20of%20Subsequences%20With%20an%20Alternating%20Sum%20Equal%20to%20K/README_EN.md) | `Array`,`Hash Table`,`Dynamic Programming` | Hard | Weekly Contest 444 | | 3510 | [Minimum Pair Removal to Sort Array II](/solution/3500-3599/3510.Minimum%20Pair%20Removal%20to%20Sort%20Array%20II/README_EN.md) | `Array`,`Hash Table`,`Linked List`,`Doubly-Linked List`,`Ordered Set`,`Simulation`,`Heap (Priority Queue)` | Hard | Weekly Contest 444 | | 3511 | [Make a Positive Array](/solution/3500-3599/3511.Make%20a%20Positive%20Array/README_EN.md) | `Greedy`,`Array`,`Prefix Sum` | Medium | 🔒 | -| 3512 | [Minimum Operations to Make Array Sum Divisible by K](/solution/3500-3599/3512.Minimum%20Operations%20to%20Make%20Array%20Sum%20Divisible%20by%20K/README_EN.md) | | Easy | Biweekly Contest 154 | -| 3513 | [Number of Unique XOR Triplets I](/solution/3500-3599/3513.Number%20of%20Unique%20XOR%20Triplets%20I/README_EN.md) | | Medium | Biweekly Contest 154 | -| 3514 | [Number of Unique XOR Triplets II](/solution/3500-3599/3514.Number%20of%20Unique%20XOR%20Triplets%20II/README_EN.md) | | Medium | Biweekly Contest 154 | -| 3515 | [Shortest Path in a Weighted Tree](/solution/3500-3599/3515.Shortest%20Path%20in%20a%20Weighted%20Tree/README_EN.md) | | Hard | Biweekly Contest 154 | -| 3516 | [Find Closest Person](/solution/3500-3599/3516.Find%20Closest%20Person/README_EN.md) | | Easy | Weekly Contest 445 | -| 3517 | [Smallest Palindromic Rearrangement I](/solution/3500-3599/3517.Smallest%20Palindromic%20Rearrangement%20I/README_EN.md) | | Medium | Weekly Contest 445 | -| 3518 | [Smallest Palindromic Rearrangement II](/solution/3500-3599/3518.Smallest%20Palindromic%20Rearrangement%20II/README_EN.md) | | Hard | Weekly Contest 445 | -| 3519 | [Count Numbers with Non-Decreasing Digits](/solution/3500-3599/3519.Count%20Numbers%20with%20Non-Decreasing%20Digits/README_EN.md) | | Hard | Weekly Contest 445 | +| 3512 | [Minimum Operations to Make Array Sum Divisible by K](/solution/3500-3599/3512.Minimum%20Operations%20to%20Make%20Array%20Sum%20Divisible%20by%20K/README_EN.md) | `Array`,`Math` | Easy | Biweekly Contest 154 | +| 3513 | [Number of Unique XOR Triplets I](/solution/3500-3599/3513.Number%20of%20Unique%20XOR%20Triplets%20I/README_EN.md) | `Bit Manipulation`,`Array`,`Math` | Medium | Biweekly Contest 154 | +| 3514 | [Number of Unique XOR Triplets II](/solution/3500-3599/3514.Number%20of%20Unique%20XOR%20Triplets%20II/README_EN.md) | `Bit Manipulation`,`Array`,`Math`,`Enumeration` | Medium | Biweekly Contest 154 | +| 3515 | [Shortest Path in a Weighted Tree](/solution/3500-3599/3515.Shortest%20Path%20in%20a%20Weighted%20Tree/README_EN.md) | `Tree`,`Depth-First Search`,`Binary Indexed Tree`,`Segment Tree`,`Array` | Hard | Biweekly Contest 154 | +| 3516 | [Find Closest Person](/solution/3500-3599/3516.Find%20Closest%20Person/README_EN.md) | `Math` | Easy | Weekly Contest 445 | +| 3517 | [Smallest Palindromic Rearrangement I](/solution/3500-3599/3517.Smallest%20Palindromic%20Rearrangement%20I/README_EN.md) | `String`,`Counting Sort`,`Sorting` | Medium | Weekly Contest 445 | +| 3518 | [Smallest Palindromic Rearrangement II](/solution/3500-3599/3518.Smallest%20Palindromic%20Rearrangement%20II/README_EN.md) | `Hash Table`,`Math`,`String`,`Combinatorics`,`Counting` | Hard | Weekly Contest 445 | +| 3519 | [Count Numbers with Non-Decreasing Digits](/solution/3500-3599/3519.Count%20Numbers%20with%20Non-Decreasing%20Digits/README_EN.md) | `Math`,`String`,`Dynamic Programming` | Hard | Weekly Contest 445 | +| 3520 | [Minimum Threshold for Inversion Pairs Count](/solution/3500-3599/3520.Minimum%20Threshold%20for%20Inversion%20Pairs%20Count/README_EN.md) | | Medium | 🔒 | +| 3521 | [Find Product Recommendation Pairs](/solution/3500-3599/3521.Find%20Product%20Recommendation%20Pairs/README_EN.md) | | Medium | | ## Copyright