Skip to content

Commit a34635a

Browse files
authored
feat: update lc problem (doocs#1522)
1 parent dbc2153 commit a34635a

File tree

3 files changed

+254
-247
lines changed

3 files changed

+254
-247
lines changed

solution/0900-0999/0928.Minimize Malware Spread II/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<p><strong>示例 1:</strong></p>
2525

2626
<pre>
27-
<strong>输出:</strong>graph = [[1,1,0],[1,1,0],[0,0,1]], initial = [0,1]
28-
<strong>输入:</strong>0
27+
<strong>输入:</strong>graph = [[1,1,0],[1,1,0],[0,0,1]], initial = [0,1]
28+
<strong>输出:</strong>0
2929
</pre>
3030

3131
<p><strong>示例 2:</strong></p>

solution/2700-2799/2715.Timeout Cancellation/README.md

+24-25
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,52 @@
66

77
<!-- 这里写题目描述 -->
88

9-
<p>Given a function <code>fn</code>, an array of&nbsp;arguments&nbsp;<code>args</code>, and a timeout&nbsp;<code>t</code>&nbsp;in milliseconds, return a cancel function <code>cancelFn</code>.</p>
9+
<p>现给定一个函数 <code>fn</code>&nbsp;,一个参数数组 <code>args</code> 和一个以毫秒为单位的超时时间 <code>t</code> ,返回一个取消函数 <code>cancelFn</code></p>
1010

11-
<p>After a delay of&nbsp;<code>t</code>,&nbsp;<code>fn</code>&nbsp;should be called with <code>args</code> passed as parameters <strong>unless</strong> <code>cancelFn</code> was invoked before the delay of <code>t</code> milliseconds elapses, specifically at <code>cancelT</code>&nbsp;ms.&nbsp;In that case,&nbsp;<code>fn</code> should never be called.</p>
11+
<p>在经过 <code>t</code> 毫秒的延迟后,应该调用 <code>fn</code> 函数,并将 <code>args</code> 作为参数传递。<strong>除非</strong> <code>t</code> 毫秒的延迟过程中,在 <code>cancelT</code> 毫秒时调用了 <code>cancelFn</code>。并且在这种情况下,<code>fn</code> 函数不应该被调用。</p>
1212

13-
<p>&nbsp;</p>
14-
<p><strong class="example">Example 1:</strong></p>
13+
<p><strong class="example">示例 1:</strong></p>
1514

1615
<pre>
17-
<strong>Input:</strong> fn = (x) =&gt; x * 5, args = [2], t = 20, cancelT = 50
18-
<strong>Output:</strong> [{&quot;time&quot;: 20, &quot;returned&quot;: 10}]
19-
<strong>Explanation:</strong>
20-
const cancel = cancellable((x) =&gt; x * 5, [2], 20); // fn(2) called at t=20ms
16+
<b>输入:</b>fn = (x) =&gt; x * 5, args = [2], t = 20, cancelT = 50
17+
<b>输出:</b>[{"time": 20, "returned": 10}]
18+
<b>解释:</b>
19+
const cancel = cancellable((x) =&gt; x * 5, [2], 20); // fn(2) t=20ms 时被调用
2120
setTimeout(cancel, 50);
2221

23-
The cancellation was scheduled to occur after a delay of cancelT (50ms), which happened after the execution of fn(2) at 20ms.
24-
</pre>
22+
取消操作被安排在延迟了 cancelT(50毫秒)后进行,这发生在 fn(2) 在20毫秒时执行之后。</pre>
2523

26-
<p><strong class="example">Example 2:</strong></p>
24+
<p><strong class="example">示例 2:</strong></p>
2725

2826
<pre>
29-
<strong>Input:</strong> fn = (x) =&gt; x**2, args = [2], t = 100, cancelT = 50
30-
<strong>Output:</strong> []
31-
<strong>Explanation:</strong>
32-
const cancel = cancellable((x) =&gt; x**2, [2], 100); // fn(2) not called
27+
<b>输入:</b>fn = (x) =&gt; x**2, args = [2], t = 100, cancelT = 50
28+
<b>输出:</b>[]
29+
<b>解释:</b>
30+
const cancel = cancellable((x) =&gt; x**2, [2], 100); // fn(2) 没被调用
3331
setTimeout(cancel, 50);
3432

35-
The cancellation was scheduled to occur after a delay of cancelT (50ms), which happened before the execution of fn(2) at 100ms, resulting in fn(2) never being called.
33+
取消操作被安排在延迟了 cancelT(50毫秒)后进行,这发生在 fn(2) 在100毫秒时执行之前,导致 fn(2) 从未被调用。
3634
</pre>
3735

38-
<p><strong class="example">Example 3:</strong></p>
36+
<p><strong class="example">示例 3:</strong></p>
3937

4038
<pre>
41-
<strong>Input:</strong> fn = (x1, x2) =&gt; x1 * x2, args = [2,4], t = 30, cancelT = 100
42-
<strong>Output:</strong> [{&quot;time&quot;: 30, &quot;returned&quot;: 8}]
43-
<strong>Explanation:</strong>
44-
const cancel = cancellable((x1, x2) =&gt; x1 * x2, [2,4], 30); // fn(2,4) called at t=30ms
39+
<b>输入:</b>fn = (x1, x2) =&gt; x1 * x2, args = [2,4], t = 30, cancelTime = 100
40+
<b>输出:</b>[{"time": 30, "returned": 8}]
41+
<b>解释:</b>
42+
const cancel = cancellable((x1, x2) =&gt; x1 * x2, [2,4], 30); // fn(2,4) t=30ms 时被调用
4543
setTimeout(cancel, 100);
4644

47-
The cancellation was scheduled to occur after a delay of cancelT (100ms), which happened after the execution of fn(2,4) at 30ms.
45+
取消操作被安排在延迟了 cancelT(100毫秒)后进行,这发生在 fn(2,4) 在30毫秒时执行之后。
4846
</pre>
4947

5048
<p>&nbsp;</p>
51-
<p><strong>Constraints:</strong></p>
49+
50+
<p><strong>提示:</strong></p>
5251

5352
<ul>
54-
<li><code>fn is a function</code></li>
55-
<li><code>args is a valid JSON array</code></li>
53+
<li><code>fn 是一个函数</code></li>
54+
<li><code>args 是一个有效的 JSON 数组</code></li>
5655
<li><code>1 &lt;= args.length &lt;= 10</code></li>
5756
<li><code><font face="monospace">20 &lt;= t &lt;= 1000</font></code></li>
5857
<li><code><font face="monospace">10 &lt;= cancelT &lt;= 1000</font></code></li>

0 commit comments

Comments
 (0)