mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-18 03:26:45 +08:00
更新国内版力扣题目描述变更
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<p>有一个有 <code>n</code> 个节点的有向图,节点按 <code>0</code> 到 <code>n - 1</code> 编号。图由一个 <strong>索引从 0 开始</strong> 的 2D 整数数组 <code>graph</code>表示, <code>graph[i]</code>是与节点 <code>i</code> 相邻的节点的整数数组,这意味着从节点 <code>i</code> 到 <code>graph[i]</code>中的每个节点都有一条边。</p>
|
||||
|
||||
<p>如果一个节点没有连出的有向边,则它是 <strong>终端节点</strong> 。如果没有出边,则节点为终端节点。如果从该节点开始的所有可能路径都通向一个 <strong>终端节点</strong> ,则该节点为 <strong>安全节点</strong> 。</p>
|
||||
<p>如果一个节点没有连出的有向边,则它是 <strong>终端节点</strong> 。如果没有出边,则节点为终端节点。如果从该节点开始的所有可能路径都通向 <strong>终端节点</strong> ,则该节点为 <strong>安全节点</strong> 。</p>
|
||||
|
||||
<p>返回一个由图中所有 <strong>安全节点</strong> 组成的数组作为答案。答案数组中的元素应当按 <strong>升序</strong> 排列。</p>
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
<strong>输入:</strong>graph = [[1,2],[2,3],[5],[0],[5],[],[]]
|
||||
<strong>输出:</strong>[2,4,5,6]
|
||||
<strong>解释:</strong>示意图如上。
|
||||
节点5和节点6是终端节点,因为它们都没有出边。
|
||||
从节点2、4、5和6开始的所有路径都指向节点5或6。
|
||||
节点 5 和节点 6 是终端节点,因为它们都没有出边。
|
||||
从节点 2、4、5 和 6 开始的所有路径都指向节点 5 或 6 。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
@@ -24,7 +24,7 @@
|
||||
<strong>输入:</strong>graph = [[1,2,3,4],[1,2],[3,4],[0,4],[]]
|
||||
<strong>输出:</strong>[4]
|
||||
<strong>解释:</strong>
|
||||
只有节点4是终端节点,从节点4开始的所有路径都通向节点4。
|
||||
只有节点 4 是终端节点,从节点 4 开始的所有路径都通向节点 4 。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
@@ -35,6 +35,7 @@
|
||||
<li><code>n == graph.length</code></li>
|
||||
<li><code>1 <= n <= 10<sup>4</sup></code></li>
|
||||
<li><code>0 <= graph[i].length <= n</code></li>
|
||||
<li><code>0 <= graph[i][j] <= n - 1</code></li>
|
||||
<li><code>graph[i]</code> 按严格递增顺序排列。</li>
|
||||
<li>图中可能包含自环。</li>
|
||||
<li>图中边的数目在范围 <code>[1, 4 * 10<sup>4</sup>]</code> 内。</li>
|
||||
|
Reference in New Issue
Block a user