Skip to content

Commit abc12e7

Browse files
authored
feat: add new lc problems (doocs#2582)
1 parent 2659300 commit abc12e7

File tree

50 files changed

+1785
-58
lines changed

Some content is hidden

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

50 files changed

+1785
-58
lines changed

solution/0100-0199/0139.Word Break/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<pre>
2828
<strong>输入:</strong> s = "applepenapple", wordDict = ["apple", "pen"]
2929
<strong>输出:</strong> true
30-
<strong>解释:</strong> 返回 true 因为 <code>"</code>applepenapple<code>"</code> 可以由 <code>"</code>apple" "pen" "apple<code>" 拼接成</code>
30+
<strong>解释:</strong> 返回 true 因为 "applepenapple" 可以由 "apple" "pen" "apple" 拼接成。
3131
&nbsp; 注意,你可以重复使用字典中的单词。
3232
</pre>
3333

solution/0100-0199/0140.Word Break II/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<p><strong class="example">示例 1:</strong></p>
1818

1919
<pre>
20-
<strong>输入:</strong>s = "<code>catsanddog</code>", wordDict = <code>["cat","cats","and","sand","dog"]</code>
21-
<strong>输出:</strong><code>["cats and dog","cat sand dog"]</code>
20+
<strong>输入:</strong>s = "catsanddog", wordDict = ["cat","cats","and","sand","dog"]
21+
<strong>输出:</strong>["cats and dog","cat sand dog"]
2222
</pre>
2323

2424
<p><strong class="example">示例 2:</strong></p>

solution/0300-0399/0351.Android Unlock Patterns/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/0300-0399/0351.Android%20Unlock%20Patterns/README_EN.md)
44

5-
<!-- tags:动态规划,回溯 -->
5+
<!-- tags:位运算,动态规划,回溯,状态压缩 -->
66

77
## 题目描述
88

solution/0300-0399/0351.Android Unlock Patterns/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/0300-0399/0351.Android%20Unlock%20Patterns/README.md)
44

5-
<!-- tags:Dynamic Programming,Backtracking -->
5+
<!-- tags:Bit Manipulation,Dynamic Programming,Backtracking,Bitmask -->
66

77
## Description
88

solution/0400-0499/0418.Sentence Screen Fitting/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/0400-0499/0418.Sentence%20Screen%20Fitting/README_EN.md)
44

5-
<!-- tags:字符串,动态规划,模拟 -->
5+
<!-- tags:数组,字符串,动态规划 -->
66

77
## 题目描述
88

solution/0400-0499/0418.Sentence Screen Fitting/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/0400-0499/0418.Sentence%20Screen%20Fitting/README.md)
44

5-
<!-- tags:String,Dynamic Programming,Simulation -->
5+
<!-- tags:Array,String,Dynamic Programming -->
66

77
## Description
88

solution/0500-0599/0548.Split Array with Equal Sum/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/0500-0599/0548.Split%20Array%20with%20Equal%20Sum/README_EN.md)
44

5-
<!-- tags:数组,前缀和 -->
5+
<!-- tags:数组,哈希表,前缀和 -->
66

77
## 题目描述
88

solution/0500-0599/0548.Split Array with Equal Sum/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[中文文档](/solution/0500-0599/0548.Split%20Array%20with%20Equal%20Sum/README.md)
44

5-
<!-- tags:Array,Prefix Sum -->
5+
<!-- tags:Array,Hash Table,Prefix Sum -->
66

77
## Description
88

solution/0600-0699/0636.Exclusive Time of Functions/README.md

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>有一个 <strong>单线程</strong> CPU 正在运行一个含有 <code>n</code> 道函数的程序。每道函数都有一个位于  <code>0</code> 和 <code>n-1</code> 之间的唯一标识符。</p>
11+
<p>有一个 <strong>单线程</strong> CPU 正在运行一个含有 <code>n</code> 道函数的程序。每道函数都有一个位于&nbsp; <code>0</code> 和 <code>n-1</code> 之间的唯一标识符。</p>
1212

1313
<p>函数调用 <strong>存储在一个 <a href="https://baike.baidu.com/item/%E8%B0%83%E7%94%A8%E6%A0%88/22718047?fr=aladdin" target="_blank">调用栈</a> 上</strong> :当一个函数调用开始时,它的标识符将会推入栈中。而当一个函数调用结束时,它的标识符将会从栈中弹出。标识符位于栈顶的函数是 <strong>当前正在执行的函数</strong> 。每当一个函数开始或者结束时,将会记录一条日志,包括函数标识符、是开始还是结束、以及相应的时间戳。</p>
1414

@@ -17,7 +17,7 @@
1717
<p>函数的 <strong>独占时间</strong> 定义是在这个函数在程序所有函数调用中执行时间的总和,调用其他函数花费的时间不算该函数的独占时间。例如,如果一个函数被调用两次,一次调用执行 <code>2</code> 单位时间,另一次调用执行 <code>1</code> 单位时间,那么该函数的 <strong>独占时间</strong> 为 <code>2 + 1 = 3</code> 。</p>
1818

1919
<p>以数组形式返回每个函数的 <strong>独占时间</strong> ,其中第 <code>i</code> 个下标对应的值表示标识符 <code>i</code> 的函数的独占时间。</p>
20-
 
20+
&nbsp;
2121

2222
<p><strong>示例 1:</strong></p>
2323
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0600-0699/0636.Exclusive%20Time%20of%20Functions/images/diag1b.png" style="width: 550px; height: 239px;" />
@@ -58,32 +58,18 @@
5858
函数 0(初始调用)在时间戳 7 的起始恢复执行,执行 1 个单位时间,于时间戳 7 的末尾结束执行。
5959
所以函数 0 总共执行 2 + 4 + 1 = 7 个单位时间,函数 1 总共执行 1 个单位时间。 </pre>
6060

61-
<p><strong>示例 4:</strong></p>
62-
63-
<pre>
64-
<strong>输入:</strong>n = 2, logs = ["0:start:0","0:start:2","0:end:5","1:start:7","1:end:7","0:end:8"]
65-
<strong>输出:</strong>[8,1]
66-
</pre>
67-
68-
<p><strong>示例 5:</strong></p>
69-
70-
<pre>
71-
<strong>输入:</strong>n = 1, logs = ["0:start:0","0:end:0"]
72-
<strong>输出:</strong>[1]
73-
</pre>
74-
75-
<p> </p>
61+
<p>&nbsp;</p>
7662

7763
<p><strong>提示:</strong></p>
7864

7965
<ul>
80-
<li><code>1 <= n <= 100</code></li>
81-
<li><code>1 <= logs.length <= 500</code></li>
82-
<li><code>0 <= function_id < n</code></li>
83-
<li><code>0 <= timestamp <= 10<sup>9</sup></code></li>
66+
<li><code>1 &lt;= n &lt;= 100</code></li>
67+
<li><code>1 &lt;= logs.length &lt;= 500</code></li>
68+
<li><code>0 &lt;= function_id &lt; n</code></li>
69+
<li><code>0 &lt;= timestamp &lt;= 10<sup>9</sup></code></li>
8470
<li>两个开始事件不会在同一时间戳发生</li>
8571
<li>两个结束事件不会在同一时间戳发生</li>
86-
<li>每道函数都有一个对应 <code>"start"</code> 日志的 <code>"end"</code> 日志</li>
72+
<li>每道函数都有一个对应&nbsp;<code>"start"</code> 日志的 <code>"end"</code> 日志</li>
8773
</ul>
8874

8975
## 解法

solution/0600-0699/0648.Replace Words/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>在英语中,我们有一个叫做&nbsp;<code>词根</code>(root) 的概念,可以词根<strong>后面</strong>添加其他一些词组成另一个较长的单词——我们称这个词为&nbsp;<code>继承词</code>(successor)。例如,词根<code>an</code>,跟随着单词&nbsp;<code>other</code>(其他),可以形成新的单词&nbsp;<code>another</code>(另一个)。</p>
11+
<p>在英语中,我们有一个叫做&nbsp;<strong>词根</strong>(root) 的概念,可以词根&nbsp;<strong>后面&nbsp;</strong>添加其他一些词组成另一个较长的单词——我们称这个词为 <strong>继承词</strong>&nbsp;(successor)。例如,词根&nbsp;<code>help</code>,跟随着 <strong>继承</strong>词&nbsp;<code>"ful"</code>,可以形成新的单词&nbsp;<code>"helpful"</code>。</p>
1212

13-
<p>现在,给定一个由许多<strong>词根</strong>组成的词典 <code>dictionary</code> 和一个用空格分隔单词形成的句子 <code>sentence</code>。你需要将句子中的所有<strong>继承词</strong>用<strong>词根</strong>替换掉。如果<strong>继承词</strong>有许多可以形成它的<strong>词根</strong>,则用<strong>最短</strong>的词根替换它。</p>
13+
<p>现在,给定一个由许多&nbsp;<strong>词根&nbsp;</strong>组成的词典 <code>dictionary</code> 和一个用空格分隔单词形成的句子 <code>sentence</code>。你需要将句子中的所有&nbsp;<strong>继承词&nbsp;</strong>用&nbsp;<strong>词根&nbsp;</strong>替换掉。如果&nbsp;<strong>继承词&nbsp;</strong>有许多可以形成它的&nbsp;<strong>词根</strong>,则用&nbsp;<strong>最短&nbsp;</strong>的 <strong>词根</strong> 替换它。</p>
1414

1515
<p>你需要输出替换之后的句子。</p>
1616

@@ -38,7 +38,7 @@
3838
<li><code>1 &lt;= dictionary.length&nbsp;&lt;= 1000</code></li>
3939
<li><code>1 &lt;= dictionary[i].length &lt;= 100</code></li>
4040
<li><code>dictionary[i]</code>&nbsp;仅由小写字母组成。</li>
41-
<li><code>1 &lt;= sentence.length &lt;= 10^6</code></li>
41+
<li><code>1 &lt;= sentence.length &lt;= 10<sup>6</sup></code></li>
4242
<li><code>sentence</code>&nbsp;仅由小写字母和空格组成。</li>
4343
<li><code>sentence</code> 中单词的总量在范围 <code>[1, 1000]</code> 内。</li>
4444
<li><code>sentence</code> 中每个单词的长度在范围 <code>[1, 1000]</code> 内。</li>

0 commit comments

Comments
 (0)