mirror of https://github.com/doocs/leetcode.git
feat: update lc problems (#3149)
This commit is contained in:
parent
ae5bc33e03
commit
a6df486896
|
|
@ -16,7 +16,7 @@ tags:
|
|||
|
||||
<!-- description:start -->
|
||||
|
||||
给你单链表的头指针 <code>head</code> 和两个整数 <code>left</code> 和 <code>right</code> ,其中 <code>left <= right</code> 。请你反转从位置 <code>left</code> 到位置 <code>right</code> 的链表节点,返回 <strong>反转后的链表</strong> 。
|
||||
给你单链表的头指针 <code>head</code> 和两个整数 <code>left</code> 和 <code>right</code> ,其中 <code>left <= right</code> 。请你反转从位置 <code>left</code> 到位置 <code>right</code> 的链表节点,返回 <strong>反转后的链表</strong> 。
|
||||
|
||||
<p> </p>
|
||||
|
||||
|
|
|
|||
|
|
@ -31,24 +31,24 @@ tags:
|
|||
<pre>
|
||||
<strong>输入:</strong>prices = [7,1,5,3,6,4]
|
||||
<strong>输出:</strong>7
|
||||
<strong>解释:</strong>在第 2 天(股票价格 = 1)的时候买入,在第 3 天(股票价格 = 5)的时候卖出, 这笔交易所能获得利润 = 5 - 1 = 4 。
|
||||
随后,在第 4 天(股票价格 = 3)的时候买入,在第 5 天(股票价格 = 6)的时候卖出, 这笔交易所能获得利润 = 6 - 3 = 3 。
|
||||
总利润为 4 + 3 = 7 。</pre>
|
||||
<strong>解释:</strong>在第 2 天(股票价格 = 1)的时候买入,在第 3 天(股票价格 = 5)的时候卖出, 这笔交易所能获得利润 = 5 - 1 = 4。
|
||||
随后,在第 4 天(股票价格 = 3)的时候买入,在第 5 天(股票价格 = 6)的时候卖出, 这笔交易所能获得利润 = 6 - 3 = 3。
|
||||
最大总利润为 4 + 3 = 7 。</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>prices = [1,2,3,4,5]
|
||||
<strong>输出:</strong>4
|
||||
<strong>解释:</strong>在第 1 天(股票价格 = 1)的时候买入,在第 5 天 (股票价格 = 5)的时候卖出, 这笔交易所能获得利润 = 5 - 1 = 4 。
|
||||
总利润为 4 。</pre>
|
||||
<strong>解释:</strong>在第 1 天(股票价格 = 1)的时候买入,在第 5 天 (股票价格 = 5)的时候卖出, 这笔交易所能获得利润 = 5 - 1 = 4。
|
||||
最大总利润为 4 。</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>prices = [7,6,4,3,1]
|
||||
<strong>输出:</strong>0
|
||||
<strong>解释:</strong>在这种情况下, 交易无法获得正利润,所以不参与交易可以获得最大利润,最大利润为 0 。</pre>
|
||||
<strong>解释:</strong>在这种情况下, 交易无法获得正利润,所以不参与交易可以获得最大利润,最大利润为 0。</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [168. Excel 表列名称](https://leetcode.cn/problems/excel-sheet-column-title)
|
||||
# [168. Excel表列名称](https://leetcode.cn/problems/excel-sheet-column-title)
|
||||
|
||||
[English Version](/solution/0100-0199/0168.Excel%20Sheet%20Column%20Title/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [177. 第 N 高的薪水](https://leetcode.cn/problems/nth-highest-salary)
|
||||
# [177. 第N高的薪水](https://leetcode.cn/problems/nth-highest-salary)
|
||||
|
||||
[English Version](/solution/0100-0199/0177.Nth%20Highest%20Salary/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [187. 重复的 DNA 序列](https://leetcode.cn/problems/repeated-dna-sequences)
|
||||
# [187. 重复的DNA序列](https://leetcode.cn/problems/repeated-dna-sequences)
|
||||
|
||||
[English Version](/solution/0100-0199/0187.Repeated%20DNA%20Sequences/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [191. 位 1 的个数](https://leetcode.cn/problems/number-of-1-bits)
|
||||
# [191. 位1的个数](https://leetcode.cn/problems/number-of-1-bits)
|
||||
|
||||
[English Version](/solution/0100-0199/0191.Number%20of%201%20Bits/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [215. 数组中的第 K 个最大元素](https://leetcode.cn/problems/kth-largest-element-in-an-array)
|
||||
# [215. 数组中的第K个最大元素](https://leetcode.cn/problems/kth-largest-element-in-an-array)
|
||||
|
||||
[English Version](/solution/0200-0299/0215.Kth%20Largest%20Element%20in%20an%20Array/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [230. 二叉搜索树中第 K 小的元素](https://leetcode.cn/problems/kth-smallest-element-in-a-bst)
|
||||
# [230. 二叉搜索树中第K小的元素](https://leetcode.cn/problems/kth-smallest-element-in-a-bst)
|
||||
|
||||
[English Version](/solution/0200-0299/0230.Kth%20Smallest%20Element%20in%20a%20BST/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ tags:
|
|||
|
||||
<!-- description:start -->
|
||||
|
||||
<p>给你一个整数数组 <code>nums</code>,返回 <em>数组 <code>answer</code> ,其中 <code>answer[i]</code> 等于 <code>nums</code> 中除 <code>nums[i]</code> 之外其余各元素的乘积</em> 。</p>
|
||||
<p>给你一个整数数组 <code>nums</code>,返回 数组 <code>answer</code> ,其中 <code>answer[i]</code> 等于 <code>nums</code> 中除 <code>nums[i]</code> 之外其余各元素的乘积 。</p>
|
||||
|
||||
<p>题目数据 <strong>保证</strong> 数组 <code>nums</code>之中任意元素的全部前缀元素和后缀的乘积都在 <strong>32 位</strong> 整数范围内。</p>
|
||||
|
||||
<p>请 <strong>不要使用除法,</strong>且在 <code>O(<em>n</em>)</code> 时间复杂度内完成此题。</p>
|
||||
<p>请 <strong>不要使用除法,</strong>且在 <code>O(n)</code> 时间复杂度内完成此题。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ tags:
|
|||
|
||||
<ul>
|
||||
<li><strong>右移</strong>:将字符串中每个字母都变为其在字母表中 <strong>后续</strong> 的字母,其中用 'a' 替换 'z'。比如,<code>"abc"</code> 能够右移为 <code>"bcd"</code>,<code>"xyz"</code> 能够右移为 <code>"yza"</code>。</li>
|
||||
<li><strong>左移</strong>:将字符串中每个字母都变为其在字母表中 <b>之前</b> 的字母,其中用 'z' 替换 'a'。比如,<code>"bcd"</code> 能够右移为 <code>"abc"</code>,<code>"yza"</code> 能够右移为 <code>"xyz"</code>。</li>
|
||||
<li><strong>左移</strong>:将字符串中每个字母都变为其在字母表中 <b>之前</b> 的字母,其中用 'z' 替换 'a'。比如,<code>"bcd"</code> 能够左移为 <code>"abc"</code>,<code>"yza"</code> 能够左移为 <code>"xyz"</code>。</li>
|
||||
</ul>
|
||||
|
||||
<p>我们可以不断地向两个方向移动字符串,形成 <strong>无限的移位序列</strong>。</p>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [342. 4 的幂](https://leetcode.cn/problems/power-of-four)
|
||||
# [342. 4的幂](https://leetcode.cn/problems/power-of-four)
|
||||
|
||||
[English Version](/solution/0300-0399/0342.Power%20of%20Four/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ solution.getRandom(); // 返回 3
|
|||
solution.getRandom(); // 返回 2
|
||||
solution.getRandom(); // 返回 2
|
||||
solution.getRandom(); // 返回 3
|
||||
// getRandom() 方法应随机返回 1、2、3 中的一个,每个元素被返回的概率相等。</pre>
|
||||
// getRandom() 方法应随机返回 1、2、3中的一个,每个元素被返回的概率相等。</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ tags:
|
|||
|
||||
<p> </p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0400-0499/0419.Battleships%20in%20a%20Board/images/battelship-grid.jpg" style="width: 333px; height: 333px;" />
|
||||
<img height="333" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0400-0499/0419.Battleships%20in%20a%20Board/images/image.png" width="333" />
|
||||
<pre>
|
||||
<strong>Input:</strong> board = [["X",".",".","X"],[".",".",".","X"],[".",".",".","X"]]
|
||||
<strong>Output:</strong> 2
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [440. 字典序的第 K 小数字](https://leetcode.cn/problems/k-th-smallest-in-lexicographical-order)
|
||||
# [440. 字典序的第K小数字](https://leetcode.cn/problems/k-th-smallest-in-lexicographical-order)
|
||||
|
||||
[English Version](/solution/0400-0499/0440.K-th%20Smallest%20in%20Lexicographical%20Order/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [468. 验证 IP 地址](https://leetcode.cn/problems/validate-ip-address)
|
||||
# [468. 验证IP地址](https://leetcode.cn/problems/validate-ip-address)
|
||||
|
||||
[English Version](/solution/0400-0499/0468.Validate%20IP%20Address/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [487. 最大连续 1 的个数 II 🔒](https://leetcode.cn/problems/max-consecutive-ones-ii)
|
||||
# [487. 最大连续1的个数 II 🔒](https://leetcode.cn/problems/max-consecutive-ones-ii)
|
||||
|
||||
[English Version](/solution/0400-0499/0487.Max%20Consecutive%20Ones%20II/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [562. 矩阵中最长的连续 1 线段 🔒](https://leetcode.cn/problems/longest-line-of-consecutive-one-in-matrix)
|
||||
# [562. 矩阵中最长的连续1线段 🔒](https://leetcode.cn/problems/longest-line-of-consecutive-one-in-matrix)
|
||||
|
||||
[English Version](/solution/0500-0599/0562.Longest%20Line%20of%20Consecutive%20One%20in%20Matrix/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [570. 至少有 5 名直接下属的经理](https://leetcode.cn/problems/managers-with-at-least-5-direct-reports)
|
||||
# [570. 至少有5名直接下属的经理](https://leetcode.cn/problems/managers-with-at-least-5-direct-reports)
|
||||
|
||||
[English Version](/solution/0500-0599/0570.Managers%20with%20at%20Least%205%20Direct%20Reports/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [585. 2016 年的投资](https://leetcode.cn/problems/investments-in-2016)
|
||||
# [585. 2016年的投资](https://leetcode.cn/problems/investments-in-2016)
|
||||
|
||||
[English Version](/solution/0500-0599/0585.Investments%20in%202016/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [596. 超过 5 名学生的课](https://leetcode.cn/problems/classes-more-than-5-students)
|
||||
# [596. 超过5名学生的课](https://leetcode.cn/problems/classes-more-than-5-students)
|
||||
|
||||
[English Version](/solution/0500-0599/0596.Classes%20More%20Than%205%20Students/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [600. 不含连续 1 的非负整数](https://leetcode.cn/problems/non-negative-integers-without-consecutive-ones)
|
||||
# [600. 不含连续1的非负整数](https://leetcode.cn/problems/non-negative-integers-without-consecutive-ones)
|
||||
|
||||
[English Version](/solution/0600-0699/0600.Non-negative%20Integers%20without%20Consecutive%20Ones/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [668. 乘法表中第 k 小的数](https://leetcode.cn/problems/kth-smallest-number-in-multiplication-table)
|
||||
# [668. 乘法表中第k小的数](https://leetcode.cn/problems/kth-smallest-number-in-multiplication-table)
|
||||
|
||||
[English Version](/solution/0600-0699/0668.Kth%20Smallest%20Number%20in%20Multiplication%20Table/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [692. 前 K 个高频单词](https://leetcode.cn/problems/top-k-frequent-words)
|
||||
# [692. 前K个高频单词](https://leetcode.cn/problems/top-k-frequent-words)
|
||||
|
||||
[English Version](/solution/0600-0699/0692.Top%20K%20Frequent%20Words/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [698. 划分为 k 个相等的子集](https://leetcode.cn/problems/partition-to-k-equal-sum-subsets)
|
||||
# [698. 划分为k个相等的子集](https://leetcode.cn/problems/partition-to-k-equal-sum-subsets)
|
||||
|
||||
[English Version](/solution/0600-0699/0698.Partition%20to%20K%20Equal%20Sum%20Subsets/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [712. 两个字符串的最小 ASCII 删除和](https://leetcode.cn/problems/minimum-ascii-delete-sum-for-two-strings)
|
||||
# [712. 两个字符串的最小ASCII删除和](https://leetcode.cn/problems/minimum-ascii-delete-sum-for-two-strings)
|
||||
|
||||
[English Version](/solution/0700-0799/0712.Minimum%20ASCII%20Delete%20Sum%20for%20Two%20Strings/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [757. 设置交集大小至少为 2](https://leetcode.cn/problems/set-intersection-size-at-least-two)
|
||||
# [757. 设置交集大小至少为2](https://leetcode.cn/problems/set-intersection-size-at-least-two)
|
||||
|
||||
[English Version](/solution/0700-0799/0757.Set%20Intersection%20Size%20At%20Least%20Two/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ tags:
|
|||
|
||||
<!-- description:start -->
|
||||
|
||||
<p>给你一棵二叉搜索树(BST)的根结点 <code>root</code> 和一个整数 <code>target</code> 。请将该树按要求拆分为两个子树:其中一个子树结点的值都必须小于等于给定的目标值;另一个子树结点的值都必须大于目标值;树中并非一定要存在值为 <code>target</code> 的结点。</p>
|
||||
<p>给你一棵二叉搜索树(BST)的根结点 <code>root</code> 和一个整数 <code>target</code> 。请将该树按要求拆分为两个子树:其中第一个子树结点的值都必须小于等于给定的目标值;另一个子树结点的值都必须大于目标值;树中并非一定要存在值为 <code>target</code> 的结点。</p>
|
||||
|
||||
<p>除此之外,树中大部分结构都需要保留,也就是说原始树中父节点 <code>p</code> 的任意子节点 <code>c</code> ,假如拆分后它们仍在同一个子树中,那么结点 <code>p</code> 应仍为 <code>c</code> 的父结点。</p>
|
||||
|
||||
<p>返回 <em>两个子树的根结点的数组</em> 。</p>
|
||||
<p>按顺序返回 <em>两个子树的根结点的数组</em> 。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [777. 在 LR 字符串中交换相邻字符](https://leetcode.cn/problems/swap-adjacent-in-lr-string)
|
||||
# [777. 在LR字符串中交换相邻字符](https://leetcode.cn/problems/swap-adjacent-in-lr-string)
|
||||
|
||||
[English Version](/solution/0700-0799/0777.Swap%20Adjacent%20in%20LR%20String/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [779. 第 K 个语法符号](https://leetcode.cn/problems/k-th-symbol-in-grammar)
|
||||
# [779. 第K个语法符号](https://leetcode.cn/problems/k-th-symbol-in-grammar)
|
||||
|
||||
[English Version](/solution/0700-0799/0779.K-th%20Symbol%20in%20Grammar/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ tags:
|
|||
|
||||
<!-- description:start -->
|
||||
|
||||
存在一个 <strong>无向图</strong> ,图中有 <code>n</code> 个节点。其中每个节点都有一个介于 <code>0</code> 到 <code>n - 1</code> 之间的唯一编号。给你一个二维数组 <code>graph</code> ,其中 <code>graph[u]</code> 是一个节点数组,由节点 <code>u</code> 的邻接节点组成。形式上,对于 <code>graph[u]</code> 中的每个 <code>v</code> ,都存在一条位于节点 <code>u</code> 和节点 <code>v</code> 之间的无向边。该无向图同时具有以下属性:
|
||||
存在一个 <strong>无向图</strong> ,图中有 <code>n</code> 个节点。其中每个节点都有一个介于 <code>0</code> 到 <code>n - 1</code> 之间的唯一编号。给你一个二维数组 <code>graph</code> ,其中 <code>graph[u]</code> 是一个节点数组,由节点 <code>u</code> 的邻接节点组成。形式上,对于 <code>graph[u]</code> 中的每个 <code>v</code> ,都存在一条位于节点 <code>u</code> 和节点 <code>v</code> 之间的无向边。该无向图同时具有以下属性:
|
||||
|
||||
<ul>
|
||||
<li>不存在自环(<code>graph[u]</code> 不包含 <code>u</code>)。</li>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1004. 最大连续 1 的个数 III](https://leetcode.cn/problems/max-consecutive-ones-iii)
|
||||
# [1004. 最大连续1的个数 III](https://leetcode.cn/problems/max-consecutive-ones-iii)
|
||||
|
||||
[English Version](/solution/1000-1099/1004.Max%20Consecutive%20Ones%20III/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1076. 项目员工 II 🔒](https://leetcode.cn/problems/project-employees-ii)
|
||||
# [1076. 项目员工II 🔒](https://leetcode.cn/problems/project-employees-ii)
|
||||
|
||||
[English Version](/solution/1000-1099/1076.Project%20Employees%20II/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1084. 销售分析 III](https://leetcode.cn/problems/sales-analysis-iii)
|
||||
# [1084. 销售分析III](https://leetcode.cn/problems/sales-analysis-iii)
|
||||
|
||||
[English Version](/solution/1000-1099/1084.Sales%20Analysis%20III/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1141. 查询近 30 天活跃用户数](https://leetcode.cn/problems/user-activity-for-the-past-30-days-i)
|
||||
# [1141. 查询近30天活跃用户数](https://leetcode.cn/problems/user-activity-for-the-past-30-days-i)
|
||||
|
||||
[English Version](/solution/1100-1199/1141.User%20Activity%20for%20the%20Past%2030%20Days%20I/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1142. 过去 30 天的用户活动 II 🔒](https://leetcode.cn/problems/user-activity-for-the-past-30-days-ii)
|
||||
# [1142. 过去30天的用户活动 II 🔒](https://leetcode.cn/problems/user-activity-for-the-past-30-days-ii)
|
||||
|
||||
[English Version](/solution/1100-1199/1142.User%20Activity%20for%20the%20Past%2030%20Days%20II/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1287. 有序数组中出现次数超过 25%的元素](https://leetcode.cn/problems/element-appearing-more-than-25-in-sorted-array)
|
||||
# [1287. 有序数组中出现次数超过25%的元素](https://leetcode.cn/problems/element-appearing-more-than-25-in-sorted-array)
|
||||
|
||||
[English Version](/solution/1200-1299/1287.Element%20Appearing%20More%20Than%2025%25%20In%20Sorted%20Array/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1378. 使用唯一标识码替换员工 ID](https://leetcode.cn/problems/replace-employee-id-with-the-unique-identifier)
|
||||
# [1378. 使用唯一标识码替换员工ID](https://leetcode.cn/problems/replace-employee-id-with-the-unique-identifier)
|
||||
|
||||
[English Version](/solution/1300-1399/1378.Replace%20Employee%20ID%20With%20The%20Unique%20Identifier/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1613. 找到遗失的 ID 🔒](https://leetcode.cn/problems/find-the-missing-ids)
|
||||
# [1613. 找到遗失的ID 🔒](https://leetcode.cn/problems/find-the-missing-ids)
|
||||
|
||||
[English Version](/solution/1600-1699/1613.Find%20the%20Missing%20IDs/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ authenticationManager.<code>renew</code>("aaa", 1); // 时刻 1 时,没有验
|
|||
authenticationManager.generate("aaa", 2); // 时刻 2 时,生成一个 tokenId 为 "aaa" 的新验证码。
|
||||
authenticationManager.<code>countUnexpiredTokens</code>(6); // 时刻 6 时,只有 tokenId 为 "aaa" 的验证码未过期,所以返回 1 。
|
||||
authenticationManager.generate("bbb", 7); // 时刻 7 时,生成一个 tokenId 为 "bbb" 的新验证码。
|
||||
authenticationManager.<code>renew</code>("aaa", 8); // tokenId 为 "aaa" 的验证码在时刻 7 过期,且 8 >= 7 ,所以时刻 8 的 renew 操作被忽略,没有验证码被更新。
|
||||
authenticationManager.<code>renew</code>("aaa", 8); // tokenId 为 "aaa" 的验证码在时刻 7 过期,且 8 >= 7 ,所以时刻 8 的renew 操作被忽略,没有验证码被更新。
|
||||
authenticationManager.<code>renew</code>("bbb", 10); // tokenId 为 "bbb" 的验证码在时刻 10 没有过期,所以 renew 操作会执行,该 token 将在时刻 15 过期。
|
||||
authenticationManager.<code>countUnexpiredTokens</code>(15); // tokenId 为 "bbb" 的验证码在时刻 15 过期,tokenId 为 "aaa" 的验证码在时刻 7 过期,所有验证码均已过期,所以返回 0 。
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1890. 2020 年最后一次登录](https://leetcode.cn/problems/the-latest-login-in-2020)
|
||||
# [1890. 2020年最后一次登录](https://leetcode.cn/problems/the-latest-login-in-2020)
|
||||
|
||||
[English Version](/solution/1800-1899/1890.The%20Latest%20Login%20in%202020/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [1892. 页面推荐 Ⅱ 🔒](https://leetcode.cn/problems/page-recommendations-ii)
|
||||
# [1892. 页面推荐Ⅱ 🔒](https://leetcode.cn/problems/page-recommendations-ii)
|
||||
|
||||
[English Version](/solution/1800-1899/1892.Page%20Recommendations%20II/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ tags:
|
|||
第二个路灯照亮的范围是 [1 - 2, 1 + 2] = [-1, 3].
|
||||
第三个路灯照亮的范围是 [3 - 3, 3 + 3] = [0, 6].
|
||||
|
||||
坐标-1 被第一个和第二个路灯照亮,亮度为 2
|
||||
坐标 0,1,2 都被第二个和第三个路灯照亮,亮度为 2.
|
||||
对于以上坐标,-1 最小,所以返回-1</pre>
|
||||
坐标-1被第一个和第二个路灯照亮,亮度为2
|
||||
坐标0,1,2都被第二个和第三个路灯照亮,亮度为2.
|
||||
对于以上坐标,-1最小,所以返回-1</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ tags:
|
|||
|
||||
<!-- description:start -->
|
||||
|
||||
<p>一个房间里有 <code>n</code> 个座位和 <code>n</code> 名学生,房间用一个数轴表示。给你一个长度为 <code>n</code> 的数组 <code>seats</code> ,其中 <code>seats[i]</code> 是第 <code>i</code> 个座位的位置。同时给你一个长度为 <code>n</code> 的数组 <code>students</code> ,其中 <code>students[j]</code> 是第 <code>j</code> 位学生的位置。</p>
|
||||
<p>一个房间里有 <code>n</code> 个 <strong>空闲</strong> 座位和 <code>n</code> 名 <strong>站着的</strong> 学生,房间用一个数轴表示。给你一个长度为 <code>n</code> 的数组 <code>seats</code> ,其中 <code>seats[i]</code> 是第 <code>i</code> 个座位的位置。同时给你一个长度为 <code>n</code> 的数组 <code>students</code> ,其中 <code>students[j]</code> 是第 <code>j</code> 位学生的位置。</p>
|
||||
|
||||
<p>你可以执行以下操作任意次:</p>
|
||||
|
||||
|
|
@ -34,9 +34,10 @@ tags:
|
|||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
<p><strong class="example">示例 1:</strong></p>
|
||||
|
||||
<pre><b>输入:</b>seats = [3,1,5], students = [2,7,4]
|
||||
<pre>
|
||||
<b>输入:</b>seats = [3,1,5], students = [2,7,4]
|
||||
<b>输出:</b>4
|
||||
<b>解释:</b>学生移动方式如下:
|
||||
- 第一位学生从位置 2 移动到位置 1 ,移动 1 次。
|
||||
|
|
@ -45,9 +46,10 @@ tags:
|
|||
总共 1 + 2 + 1 = 4 次移动。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
<p><strong class="example">示例 2:</strong></p>
|
||||
|
||||
<pre><b>输入:</b>seats = [4,1,5,9], students = [1,3,2,6]
|
||||
<pre>
|
||||
<b>输入:</b>seats = [4,1,5,9], students = [1,3,2,6]
|
||||
<b>输出:</b>7
|
||||
<strong>解释:</strong>学生移动方式如下:
|
||||
- 第一位学生不移动。
|
||||
|
|
@ -57,9 +59,10 @@ tags:
|
|||
总共 0 + 1 + 3 + 3 = 7 次移动。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
<p><strong class="example">示例 3:</strong></p>
|
||||
|
||||
<pre><b>输入:</b>seats = [2,2,6,6], students = [1,3,2,6]
|
||||
<pre>
|
||||
<b>输入:</b>seats = [2,2,6,6], students = [1,3,2,6]
|
||||
<b>输出:</b>4
|
||||
<b>解释:</b>学生移动方式如下:
|
||||
- 第一位学生从位置 1 移动到位置 2 ,移动 1 次。
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ tags:
|
|||
|
||||
遍历结束后,返回答案变量 `ans` 即可。
|
||||
|
||||
时间复杂度 $O(n)$,空间复杂度 $O(1)$。其中 $n$ 为数组 `prices` 的长度。
|
||||
时间复杂度 $O(n)$,其中 $n$ 为数组 `prices` 的长度。空间复杂度 $O(1)$。
|
||||
|
||||
<!-- tabs:start -->
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,17 @@ Note that [8,6] is not a smooth descent period as 8 - 6 ≠ 1.
|
|||
|
||||
<!-- solution:start -->
|
||||
|
||||
### Solution 1
|
||||
### Solution 1: Two Pointers
|
||||
|
||||
We define an answer variable `ans`, initially set to $0$.
|
||||
|
||||
Next, we use two pointers $i$ and $j$, pointing to the first day of the current smooth decline phase and the day after the last day of this phase, respectively. Initially, $i = 0$, $j = 0$.
|
||||
|
||||
Iterate through the array `prices` from left to right. For each position $i$, we move $j$ to the right until $j$ reaches the end of the array or $prices[j - 1] - prices[j] \neq 1$. At this point, $cnt = j - i$ is the length of the current smooth decline phase, and we add $\frac{(1 + cnt) \times cnt}{2}$ to the answer variable `ans`. Then, we update $i$ to $j$ and continue the iteration.
|
||||
|
||||
After the iteration ends, return the answer variable `ans`.
|
||||
|
||||
The time complexity is $O(n)$, where $n$ is the length of the array `prices`. The space complexity is $O(1)$.
|
||||
|
||||
<!-- tabs:start -->
|
||||
|
||||
|
|
|
|||
|
|
@ -181,6 +181,26 @@ func elementInNums(nums []int, queries [][]int) []int {
|
|||
}
|
||||
```
|
||||
|
||||
#### TypeScript
|
||||
|
||||
```ts
|
||||
function elementInNums(nums: number[], queries: number[][]): number[] {
|
||||
const n = nums.length;
|
||||
const m = queries.length;
|
||||
const ans: number[] = Array(m).fill(-1);
|
||||
for (let j = 0; j < m; ++j) {
|
||||
let [t, i] = queries[j];
|
||||
t %= 2 * n;
|
||||
if (t < n && i < n - t) {
|
||||
ans[j] = nums[i + t];
|
||||
} else if (t >= n && i < t - n) {
|
||||
ans[j] = nums[i];
|
||||
}
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
```
|
||||
|
||||
<!-- tabs:end -->
|
||||
|
||||
<!-- solution:end -->
|
||||
|
|
|
|||
|
|
@ -86,7 +86,18 @@ At minute 3, nums[0] does not exist.
|
|||
|
||||
<!-- solution:start -->
|
||||
|
||||
### Solution 1
|
||||
### Solution 1: Direct Calculation
|
||||
|
||||
First, we initialize an array $ans$ with length $m$ to store the answers, initializing all elements to $-1$.
|
||||
|
||||
Next, we iterate through the array $queries$. For each query, we first obtain the current query time $t$ and index $i$. We then take $t$ modulo $2n$ and compare $t$ with $n$:
|
||||
|
||||
- If $t < n$, then the number of array elements at time $t$ is $n - t$, and the array elements are the result of the original array elements shifted left by $t$ positions. Therefore, if $i < n - t$, the answer is $nums[i + t]$;
|
||||
- If $t > n$, then the number of array elements at time $t$ is $t - n$, and the array elements are the first $t - n$ elements of the original array. Therefore, if $i < t - n$, the answer is $nums[i]$.
|
||||
|
||||
Finally, return the array $ans$.
|
||||
|
||||
The time complexity is $O(m)$, where $m$ is the length of the array $queries$. Ignoring the space consumed by the answer array, the space complexity is $O(1)$.
|
||||
|
||||
<!-- tabs:start -->
|
||||
|
||||
|
|
@ -170,6 +181,26 @@ func elementInNums(nums []int, queries [][]int) []int {
|
|||
}
|
||||
```
|
||||
|
||||
#### TypeScript
|
||||
|
||||
```ts
|
||||
function elementInNums(nums: number[], queries: number[][]): number[] {
|
||||
const n = nums.length;
|
||||
const m = queries.length;
|
||||
const ans: number[] = Array(m).fill(-1);
|
||||
for (let j = 0; j < m; ++j) {
|
||||
let [t, i] = queries[j];
|
||||
t %= 2 * n;
|
||||
if (t < n && i < n - t) {
|
||||
ans[j] = nums[i + t];
|
||||
} else if (t >= n && i < t - n) {
|
||||
ans[j] = nums[i];
|
||||
}
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
```
|
||||
|
||||
<!-- tabs:end -->
|
||||
|
||||
<!-- solution:end -->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
function elementInNums(nums: number[], queries: number[][]): number[] {
|
||||
const n = nums.length;
|
||||
const m = queries.length;
|
||||
const ans: number[] = Array(m).fill(-1);
|
||||
for (let j = 0; j < m; ++j) {
|
||||
let [t, i] = queries[j];
|
||||
t %= 2 * n;
|
||||
if (t < n && i < n - t) {
|
||||
ans[j] = nums[i + t];
|
||||
} else if (t >= n && i < t - n) {
|
||||
ans[j] = nums[i];
|
||||
}
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
|
|
@ -68,7 +68,7 @@ tags:
|
|||
|
||||
我们遍历数组 `sentences`,对于每个句子,我们计算其中的空格数,那么单词数就是空格数加 $1$。最后返回最大的单词数即可。
|
||||
|
||||
时间复杂度 $O(L)$,空间复杂度 $O(1)$。其中 $L$ 是数组 `sentences` 中所有字符串的长度之和。
|
||||
时间复杂度 $O(L)$,其中 $L$ 是数组 `sentences` 中所有字符串的长度之和。空间复杂度 $O(1)$。
|
||||
|
||||
<!-- tabs:start -->
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,11 @@ In this example, the second and third sentences (underlined) have the same numbe
|
|||
|
||||
<!-- solution:start -->
|
||||
|
||||
### Solution 1
|
||||
### Solution 1: Space Counting
|
||||
|
||||
We iterate through the array `sentences`. For each sentence, we count the number of spaces, then the number of words is the number of spaces plus $1$. Finally, we return the maximum number of words.
|
||||
|
||||
The time complexity is $O(L)$, where $L$ is the total length of all strings in the array `sentences`. The space complexity is $O(1)$.
|
||||
|
||||
<!-- tabs:start -->
|
||||
|
||||
|
|
|
|||
|
|
@ -106,16 +106,14 @@ class Solution:
|
|||
for v in b:
|
||||
g[v].append(a)
|
||||
indeg[a] += len(b)
|
||||
q = deque(supplies)
|
||||
q = supplies
|
||||
ans = []
|
||||
while q:
|
||||
for _ in range(len(q)):
|
||||
i = q.popleft()
|
||||
for j in g[i]:
|
||||
indeg[j] -= 1
|
||||
if indeg[j] == 0:
|
||||
ans.append(j)
|
||||
q.append(j)
|
||||
for i in q:
|
||||
for j in g[i]:
|
||||
indeg[j] -= 1
|
||||
if indeg[j] == 0:
|
||||
ans.append(j)
|
||||
q.append(j)
|
||||
return ans
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -97,16 +97,14 @@ class Solution:
|
|||
for v in b:
|
||||
g[v].append(a)
|
||||
indeg[a] += len(b)
|
||||
q = deque(supplies)
|
||||
q = supplies
|
||||
ans = []
|
||||
while q:
|
||||
for _ in range(len(q)):
|
||||
i = q.popleft()
|
||||
for j in g[i]:
|
||||
indeg[j] -= 1
|
||||
if indeg[j] == 0:
|
||||
ans.append(j)
|
||||
q.append(j)
|
||||
for i in q:
|
||||
for j in g[i]:
|
||||
indeg[j] -= 1
|
||||
if indeg[j] == 0:
|
||||
ans.append(j)
|
||||
q.append(j)
|
||||
return ans
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -8,14 +8,12 @@ class Solution:
|
|||
for v in b:
|
||||
g[v].append(a)
|
||||
indeg[a] += len(b)
|
||||
q = deque(supplies)
|
||||
q = supplies
|
||||
ans = []
|
||||
while q:
|
||||
for _ in range(len(q)):
|
||||
i = q.popleft()
|
||||
for j in g[i]:
|
||||
indeg[j] -= 1
|
||||
if indeg[j] == 0:
|
||||
ans.append(j)
|
||||
q.append(j)
|
||||
for i in q:
|
||||
for j in g[i]:
|
||||
indeg[j] -= 1
|
||||
if indeg[j] == 0:
|
||||
ans.append(j)
|
||||
q.append(j)
|
||||
return ans
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ tags:
|
|||
- 位置 3 由第二和第三路灯覆盖。它被 2 个路灯覆盖,比 requirement[3] 少。
|
||||
- 位置 4 被第三个路灯覆盖。它被 1 盏路灯覆盖,等于 requirement[4]。
|
||||
|
||||
位置 0、1、2、4 满足要求,因此返回 4。
|
||||
位置 0、1、2、4 满足要求,因此返回4。
|
||||
|
||||
</pre>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tags:
|
|||
|
||||
<!-- problem:start -->
|
||||
|
||||
# [2329. 产品销售分析 Ⅴ 🔒](https://leetcode.cn/problems/product-sales-analysis-v)
|
||||
# [2329. 产品销售分析Ⅴ 🔒](https://leetcode.cn/problems/product-sales-analysis-v)
|
||||
|
||||
[English Version](/solution/2300-2399/2329.Product%20Sales%20Analysis%20V/README_EN.md)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ tags:
|
|||
<pre>
|
||||
<strong>Input:</strong> n = 105
|
||||
<strong>Output:</strong> "357"
|
||||
<strong>Explanation:</strong> 3 * 5 * 7 = 105. It can be shown that 357 is the smallest number with a product of digits equal to 105. So the answer would be "105".
|
||||
<strong>Explanation:</strong> 3 * 5 * 7 = 105. It can be shown that 357 is the smallest number with a product of digits equal to 105. So the answer would be "357".
|
||||
</pre>
|
||||
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
|
|
|||
|
|
@ -38,13 +38,13 @@ tags:
|
|||
|
||||
<p><strong>解释:</strong></p>
|
||||
|
||||
<p>子数组 <code>nums[2..3]</code> 的按位 <code>OR</code> 运算值为 3 ,得到最小差值 <code>|3 - 3| = 0</code> 。</p>
|
||||
<p>子数组 <code>nums[0..1]</code> 的按位 <code>OR</code> 运算值为 3 ,得到最小差值 <code>|3 - 3| = 0</code> 。</p>
|
||||
</div>
|
||||
|
||||
<p><strong class="example">示例 2:</strong></p>
|
||||
|
||||
<div class="example-block">
|
||||
<p><span class="example-io"><b>输入:</b>nums = [1,2,1,2], k = 2</span></p>
|
||||
<p><span class="example-io"><b>输入:</b>nums = [1,3,1,3], k = 2</span></p>
|
||||
|
||||
<p><span class="example-io"><b>输出:</b>1</span></p>
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -12,7 +12,7 @@
|
|||
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ---- | ---- |
|
||||
| 0175 | [组合两个表](/solution/0100-0199/0175.Combine%20Two%20Tables/README.md) | `数据库` | 简单 | |
|
||||
| 0176 | [第二高的薪水](/solution/0100-0199/0176.Second%20Highest%20Salary/README.md) | `数据库` | 中等 | |
|
||||
| 0177 | [第 N 高的薪水](/solution/0100-0199/0177.Nth%20Highest%20Salary/README.md) | `数据库` | 中等 | |
|
||||
| 0177 | [第N高的薪水](/solution/0100-0199/0177.Nth%20Highest%20Salary/README.md) | `数据库` | 中等 | |
|
||||
| 0178 | [分数排名](/solution/0100-0199/0178.Rank%20Scores/README.md) | `数据库` | 中等 | |
|
||||
| 0180 | [连续出现的数字](/solution/0100-0199/0180.Consecutive%20Numbers/README.md) | `数据库` | 中等 | |
|
||||
| 0181 | [超过经理收入的员工](/solution/0100-0199/0181.Employees%20Earning%20More%20Than%20Their%20Managers/README.md) | `数据库` | 简单 | |
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
| 0534 | [游戏玩法分析 III](/solution/0500-0599/0534.Game%20Play%20Analysis%20III/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 0550 | [游戏玩法分析 IV](/solution/0500-0599/0550.Game%20Play%20Analysis%20IV/README.md) | `数据库` | 中等 | |
|
||||
| 0569 | [员工薪水中位数](/solution/0500-0599/0569.Median%20Employee%20Salary/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 0570 | [至少有 5 名直接下属的经理](/solution/0500-0599/0570.Managers%20with%20at%20Least%205%20Direct%20Reports/README.md) | `数据库` | 中等 | |
|
||||
| 0570 | [至少有5名直接下属的经理](/solution/0500-0599/0570.Managers%20with%20at%20Least%205%20Direct%20Reports/README.md) | `数据库` | 中等 | |
|
||||
| 0571 | [给定数字的频率查询中位数](/solution/0500-0599/0571.Find%20Median%20Given%20Frequency%20of%20Numbers/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 0574 | [当选者](/solution/0500-0599/0574.Winning%20Candidate/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 0577 | [员工奖金](/solution/0500-0599/0577.Employee%20Bonus/README.md) | `数据库` | 简单 | |
|
||||
|
|
@ -36,10 +36,10 @@
|
|||
| 0579 | [查询员工的累计薪水](/solution/0500-0599/0579.Find%20Cumulative%20Salary%20of%20an%20Employee/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 0580 | [统计各专业学生人数](/solution/0500-0599/0580.Count%20Student%20Number%20in%20Departments/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 0584 | [寻找用户推荐人](/solution/0500-0599/0584.Find%20Customer%20Referee/README.md) | `数据库` | 简单 | |
|
||||
| 0585 | [2016 年的投资](/solution/0500-0599/0585.Investments%20in%202016/README.md) | `数据库` | 中等 | |
|
||||
| 0585 | [2016年的投资](/solution/0500-0599/0585.Investments%20in%202016/README.md) | `数据库` | 中等 | |
|
||||
| 0586 | [订单最多的客户](/solution/0500-0599/0586.Customer%20Placing%20the%20Largest%20Number%20of%20Orders/README.md) | `数据库` | 简单 | |
|
||||
| 0595 | [大的国家](/solution/0500-0599/0595.Big%20Countries/README.md) | `数据库` | 简单 | |
|
||||
| 0596 | [超过 5 名学生的课](/solution/0500-0599/0596.Classes%20More%20Than%205%20Students/README.md) | `数据库` | 简单 | |
|
||||
| 0596 | [超过5名学生的课](/solution/0500-0599/0596.Classes%20More%20Than%205%20Students/README.md) | `数据库` | 简单 | |
|
||||
| 0597 | [好友申请 I:总体通过率](/solution/0500-0599/0597.Friend%20Requests%20I%20Overall%20Acceptance%20Rate/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 0601 | [体育馆的人流量](/solution/0600-0699/0601.Human%20Traffic%20of%20Stadium/README.md) | `数据库` | 困难 | |
|
||||
| 0602 | [好友申请 II :谁有最多的好友](/solution/0600-0699/0602.Friend%20Requests%20II%20Who%20Has%20the%20Most%20Friends/README.md) | `数据库` | 中等 | |
|
||||
|
|
@ -62,11 +62,11 @@
|
|||
| 1069 | [产品销售分析 II](/solution/1000-1099/1069.Product%20Sales%20Analysis%20II/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 1070 | [产品销售分析 III](/solution/1000-1099/1070.Product%20Sales%20Analysis%20III/README.md) | `数据库` | 中等 | |
|
||||
| 1075 | [项目员工 I](/solution/1000-1099/1075.Project%20Employees%20I/README.md) | `数据库` | 简单 | |
|
||||
| 1076 | [项目员工 II](/solution/1000-1099/1076.Project%20Employees%20II/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 1076 | [项目员工II](/solution/1000-1099/1076.Project%20Employees%20II/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 1077 | [项目员工 III](/solution/1000-1099/1077.Project%20Employees%20III/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1082 | [销售分析 I ](/solution/1000-1099/1082.Sales%20Analysis%20I/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 1083 | [销售分析 II](/solution/1000-1099/1083.Sales%20Analysis%20II/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 1084 | [销售分析 III](/solution/1000-1099/1084.Sales%20Analysis%20III/README.md) | `数据库` | 简单 | |
|
||||
| 1084 | [销售分析III](/solution/1000-1099/1084.Sales%20Analysis%20III/README.md) | `数据库` | 简单 | |
|
||||
| 1097 | [游戏玩法分析 V](/solution/1000-1099/1097.Game%20Play%20Analysis%20V/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 1098 | [小众书籍](/solution/1000-1099/1098.Unpopular%20Books/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1107 | [每日新用户统计](/solution/1100-1199/1107.New%20Users%20Daily%20Count/README.md) | `数据库` | 中等 | 🔒 |
|
||||
|
|
@ -75,8 +75,8 @@
|
|||
| 1126 | [查询活跃业务](/solution/1100-1199/1126.Active%20Businesses/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1127 | [用户购买平台](/solution/1100-1199/1127.User%20Purchase%20Platform/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 1132 | [报告的记录 II](/solution/1100-1199/1132.Reported%20Posts%20II/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1141 | [查询近 30 天活跃用户数](/solution/1100-1199/1141.User%20Activity%20for%20the%20Past%2030%20Days%20I/README.md) | `数据库` | 简单 | |
|
||||
| 1142 | [过去 30 天的用户活动 II](/solution/1100-1199/1142.User%20Activity%20for%20the%20Past%2030%20Days%20II/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 1141 | [查询近30天活跃用户数](/solution/1100-1199/1141.User%20Activity%20for%20the%20Past%2030%20Days%20I/README.md) | `数据库` | 简单 | |
|
||||
| 1142 | [过去30天的用户活动 II](/solution/1100-1199/1142.User%20Activity%20for%20the%20Past%2030%20Days%20II/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 1148 | [文章浏览 I](/solution/1100-1199/1148.Article%20Views%20I/README.md) | `数据库` | 简单 | |
|
||||
| 1149 | [文章浏览 II](/solution/1100-1199/1149.Article%20Views%20II/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1158 | [市场分析 I](/solution/1100-1199/1158.Market%20Analysis%20I/README.md) | `数据库` | 中等 | |
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
| 1355 | [活动参与者](/solution/1300-1399/1355.Activity%20Participants/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1364 | [顾客的可信联系人数量](/solution/1300-1399/1364.Number%20of%20Trusted%20Contacts%20of%20a%20Customer/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1369 | [获取最近第二次的活动](/solution/1300-1399/1369.Get%20the%20Second%20Most%20Recent%20Activity/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 1378 | [使用唯一标识码替换员工 ID](/solution/1300-1399/1378.Replace%20Employee%20ID%20With%20The%20Unique%20Identifier/README.md) | `数据库` | 简单 | |
|
||||
| 1378 | [使用唯一标识码替换员工ID](/solution/1300-1399/1378.Replace%20Employee%20ID%20With%20The%20Unique%20Identifier/README.md) | `数据库` | 简单 | |
|
||||
| 1384 | [按年度列出销售总额](/solution/1300-1399/1384.Total%20Sales%20Amount%20by%20Year/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 1393 | [股票的资本损益](/solution/1300-1399/1393.Capital%20GainLoss/README.md) | `数据库` | 中等 | |
|
||||
| 1398 | [购买了产品 A 和产品 B 却没有购买产品 C 的顾客](/solution/1300-1399/1398.Customers%20Who%20Bought%20Products%20A%20and%20B%20but%20Not%20C/README.md) | `数据库` | 中等 | 🔒 |
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
| 1587 | [银行账户概要 II](/solution/1500-1599/1587.Bank%20Account%20Summary%20II/README.md) | `数据库` | 简单 | |
|
||||
| 1596 | [每位顾客最经常订购的商品](/solution/1500-1599/1596.The%20Most%20Frequently%20Ordered%20Products%20for%20Each%20Customer/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1607 | [没有卖出的卖家](/solution/1600-1699/1607.Sellers%20With%20No%20Sales/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 1613 | [找到遗失的 ID](/solution/1600-1699/1613.Find%20the%20Missing%20IDs/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1613 | [找到遗失的ID](/solution/1600-1699/1613.Find%20the%20Missing%20IDs/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1623 | [三人国家代表队](/solution/1600-1699/1623.All%20Valid%20Triplets%20That%20Can%20Represent%20a%20Country/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 1633 | [各赛事的用户注册率](/solution/1600-1699/1633.Percentage%20of%20Users%20Attended%20a%20Contest/README.md) | `数据库` | 简单 | |
|
||||
| 1635 | [Hopper 公司查询 I](/solution/1600-1699/1635.Hopper%20Company%20Queries%20I/README.md) | `数据库` | 困难 | 🔒 |
|
||||
|
|
@ -174,8 +174,8 @@
|
|||
| 1867 | [最大数量高于平均水平的订单](/solution/1800-1899/1867.Orders%20With%20Maximum%20Quantity%20Above%20Average/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1873 | [计算特殊奖金](/solution/1800-1899/1873.Calculate%20Special%20Bonus/README.md) | `数据库` | 简单 | |
|
||||
| 1875 | [将工资相同的雇员分组](/solution/1800-1899/1875.Group%20Employees%20of%20the%20Same%20Salary/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 1890 | [2020 年最后一次登录](/solution/1800-1899/1890.The%20Latest%20Login%20in%202020/README.md) | `数据库` | 简单 | |
|
||||
| 1892 | [页面推荐 Ⅱ](/solution/1800-1899/1892.Page%20Recommendations%20II/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 1890 | [2020年最后一次登录](/solution/1800-1899/1890.The%20Latest%20Login%20in%202020/README.md) | `数据库` | 简单 | |
|
||||
| 1892 | [页面推荐Ⅱ](/solution/1800-1899/1892.Page%20Recommendations%20II/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 1907 | [按分类统计薪水](/solution/1900-1999/1907.Count%20Salary%20Categories/README.md) | `数据库` | 中等 | |
|
||||
| 1917 | [Leetcodify 好友推荐](/solution/1900-1999/1917.Leetcodify%20Friends%20Recommendations/README.md) | `数据库` | 困难 | 🔒 |
|
||||
| 1919 | [兴趣相同的朋友](/solution/1900-1999/1919.Leetcodify%20Similar%20Friends/README.md) | `数据库` | 困难 | 🔒 |
|
||||
|
|
@ -217,7 +217,7 @@
|
|||
| 2308 | [按性别排列表格](/solution/2300-2399/2308.Arrange%20Table%20by%20Gender/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 2314 | [每个城市最高气温的第一天](/solution/2300-2399/2314.The%20First%20Day%20of%20the%20Maximum%20Recorded%20Degree%20in%20Each%20City/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 2324 | [产品销售分析 IV](/solution/2300-2399/2324.Product%20Sales%20Analysis%20IV/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 2329 | [产品销售分析 Ⅴ](/solution/2300-2399/2329.Product%20Sales%20Analysis%20V/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 2329 | [产品销售分析Ⅴ](/solution/2300-2399/2329.Product%20Sales%20Analysis%20V/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 2339 | [联赛的所有比赛](/solution/2300-2399/2339.All%20the%20Matches%20of%20the%20League/README.md) | `数据库` | 简单 | 🔒 |
|
||||
| 2346 | [以百分比计算排名](/solution/2300-2399/2346.Compute%20the%20Rank%20as%20a%20Percentage/README.md) | `数据库` | 中等 | 🔒 |
|
||||
| 2356 | [每位教师所教授的科目种类的数量](/solution/2300-2399/2356.Number%20of%20Unique%20Subjects%20Taught%20by%20Each%20Teacher/README.md) | `数据库` | 简单 | |
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# JavaScript 专项练习
|
||||
# JavaScript专项练习
|
||||
|
||||
[English Version](/solution/JAVASCRIPT_README_EN.md)
|
||||
|
||||
|
|
|
|||
6385
solution/README.md
6385
solution/README.md
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue