Skip to content

Commit 7fb7d02

Browse files
authored
feat: add new lc problems (doocs#4379)
1 parent 43b825f commit 7fb7d02

File tree

160 files changed

+3145
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+3145
-87
lines changed

solution/0100-0199/0115.Distinct Subsequences/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ tags:
1717

1818
<!-- description:start -->
1919

20-
<p>给你两个字符串 <code>s</code><strong> </strong>和 <code>t</code> ,统计并返回在 <code>s</code> 的 <strong>子序列</strong> 中 <code>t</code> 出现的个数,结果需要对&nbsp;10<sup>9</sup> + 7 取模。</p>
20+
<p>给你两个字符串 <code>s</code><strong> </strong>和 <code>t</code> ,统计并返回在 <code>s</code> 的 <strong>子序列</strong> 中 <code>t</code> 出现的个数。</p>
21+
22+
<p>测试用例保证结果在 32 位有符号整数范围内。</p>
2123

2224
<p>&nbsp;</p>
2325

solution/0100-0199/0177.Nth Highest Salary/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ tags:
2525
| id | int |
2626
| salary | int |
2727
+-------------+------+
28-
在 SQL 中,id 是该表的主键。
28+
id 是该表的主键(列中的值互不相同)
2929
该表的每一行都包含有关员工工资的信息。
3030
</pre>
3131

3232
<p>&nbsp;</p>
3333

34-
<p>查询&nbsp;<code>Employee</code> 表中第 <code>n</code> 高的工资。如果没有第 <code>n</code> 个最高工资,查询结果应该为&nbsp;<code>null</code> 。</p>
34+
<p>编写一个解决方案查询&nbsp;<code>Employee</code> 表中第 <code>n</code> 高的&nbsp;<strong>不同</strong> 工资。如果少于&nbsp;<code>n</code> 个不同工资,查询结果应该为&nbsp;<code>null</code> 。</p>
3535

3636
<p>查询结果格式如下所示。</p>
3737

solution/0100-0199/0177.Nth Highest Salary/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Each row of this table contains information about the salary of an employee.
3131

3232
<p>&nbsp;</p>
3333

34-
<p>Write a solution to find the <code>n<sup>th</sup></code> highest salary from the <code>Employee</code> table. If there is no <code>n<sup>th</sup></code> highest salary, return&nbsp;<code>null</code>.</p>
34+
<p>Write a solution to find the <code>n<sup>th</sup></code> highest <strong>distinct</strong> salary from the <code>Employee</code> table. If there are less than <code>n</code> distinct salaries, return&nbsp;<code>null</code>.</p>
3535

3636
<p>The result format is in the following example.</p>
3737

solution/0200-0299/0275.H-Index II/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ tags:
1717

1818
<!-- description:start -->
1919

20-
<p>给你一个整数数组 <code>citations</code> ,其中 <code>citations[i]</code> 表示研究者的第 <code>i</code> 篇论文被引用的次数,<code>citations</code> 已经按照&nbsp;<strong>升序排列&nbsp;</strong>。计算并返回该研究者的 h<strong><em>&nbsp;</em></strong>指数。</p>
20+
<p>给你一个整数数组 <code>citations</code> ,其中 <code>citations[i]</code> 表示研究者的第 <code>i</code> 篇论文被引用的次数,<code>citations</code> 已经按照&nbsp;<strong>非降序排列&nbsp;</strong>。计算并返回该研究者的 h<strong><em>&nbsp;</em></strong>指数。</p>
2121

2222
<p><a href="https://baike.baidu.com/item/h-index/3991452?fr=aladdin" target="_blank">h 指数的定义</a>:h 代表“高引用次数”(high citations),一名科研人员的 <code>h</code> 指数是指他(她)的 (<code>n</code> 篇论文中)<strong>至少&nbsp;</strong>有 <code>h</code> 篇论文分别被引用了<strong>至少</strong> <code>h</code> 次。</p>
2323

solution/0200-0299/0275.H-Index II/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ tags:
1717

1818
<!-- description:start -->
1919

20-
<p>Given an array of integers <code>citations</code> where <code>citations[i]</code> is the number of citations a researcher received for their <code>i<sup>th</sup></code> paper and <code>citations</code> is sorted in <strong>ascending order</strong>, return <em>the researcher&#39;s h-index</em>.</p>
20+
<p>Given an array of integers <code>citations</code> where <code>citations[i]</code> is the number of citations a researcher received for their <code>i<sup>th</sup></code> paper and <code>citations</code> is sorted in <strong>non-descending order</strong>, return <em>the researcher&#39;s h-index</em>.</p>
2121

2222
<p>According to the <a href="https://en.wikipedia.org/wiki/H-index" target="_blank">definition of h-index on Wikipedia</a>: The h-index is defined as the maximum value of <code>h</code> such that the given researcher has published at least <code>h</code> papers that have each been cited at least <code>h</code> times.</p>
2323

solution/0300-0399/0317.Shortest Distance from All Buildings/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ tags:
3232

3333
<p><strong>总旅行距离&nbsp;</strong>是朋友们家到聚会地点的距离之和。</p>
3434

35-
<p>使用 <strong>曼哈顿距离</strong>&nbsp;计算距离,其中距离 <code>(p1, p2) = |p2.x - p1.x | + | p2.y - p1.y |</code> 。</p>
36-
3735
<p>&nbsp;</p>
3836

3937
<p><strong>示例&nbsp; 1:</strong></p>

solution/0300-0399/0317.Shortest Distance from All Buildings/README_EN.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ tags:
3232

3333
<p>The <strong>total travel distance</strong> is the sum of the distances between the houses of the friends and the meeting point.</p>
3434

35-
<p>The distance is calculated using <a href="http://en.wikipedia.org/wiki/Taxicab_geometry" target="_blank">Manhattan Distance</a>, where <code>distance(p1, p2) = |p2.x - p1.x| + |p2.y - p1.y|</code>.</p>
36-
3735
<p>&nbsp;</p>
3836
<p><strong class="example">Example 1:</strong></p>
3937
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0317.Shortest%20Distance%20from%20All%20Buildings/images/buildings-grid.jpg" style="width: 413px; height: 253px;" />

solution/0600-0699/0689.Maximum Sum of 3 Non-Overlapping Subarrays/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0600-0699/0689.Ma
55
tags:
66
- 数组
77
- 动态规划
8+
- 前缀和
9+
- 滑动窗口
810
---
911

1012
<!-- problem:start -->

solution/0600-0699/0689.Maximum Sum of 3 Non-Overlapping Subarrays/README_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0600-0699/0689.Ma
55
tags:
66
- Array
77
- Dynamic Programming
8+
- Prefix Sum
9+
- Sliding Window
810
---
911

1012
<!-- problem:start -->

solution/0700-0799/0759.Employee Free Time/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0700-0799/0759.Em
55
tags:
66
- 数组
77
- 排序
8+
- 扫描线
89
- 堆(优先队列)
910
---
1011

0 commit comments

Comments
 (0)