1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-07 00:11:41 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一份旅游线路图,该线路图中的旅行线路用数组 <code>paths</code> 表示,其中 <code>paths[i] = [cityA<sub>i</sub>, cityB<sub>i</sub>]</code> 表示该线路将会从 <code>cityA<sub>i</sub></code> 直接前往 <code>cityB<sub>i</sub></code> 。请你找出这次旅行的终点站,即没有任何可以通往其他城市的线路的城市<em>。</em></p>\n\n<p>题目数据保证线路图会形成一条不存在循环的线路,因此恰有一个旅行终点站。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>paths = [[\"London\",\"New York\"],[\"New York\",\"Lima\"],[\"Lima\",\"Sao Paulo\"]]\n<strong>输出:</strong>\"Sao Paulo\" \n<strong>解释:</strong>从 \"London\" 出发,最后抵达终点站 \"Sao Paulo\" 。本次旅行的路线是 \"London\" -&gt; \"New York\" -&gt; \"Lima\" -&gt; \"Sao Paulo\" 。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>paths = [[\"B\",\"C\"],[\"D\",\"B\"],[\"C\",\"A\"]]\n<strong>输出:</strong>\"A\"\n<strong>解释:</strong>所有可能的线路是:\n\"D\" -&gt; \"B\" -&gt; \"C\" -&gt; \"A\".&nbsp;\n\"B\" -&gt; \"C\" -&gt; \"A\".&nbsp;\n\"C\" -&gt; \"A\".&nbsp;\n\"A\".&nbsp;\n显然旅行终点站是 \"A\" 。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>paths = [[\"A\",\"Z\"]]\n<strong>输出:</strong>\"Z\"\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= paths.length &lt;= 100</code></li>\n\t<li><code>paths[i].length == 2</code></li>\n\t<li><code>1 &lt;=&nbsp;cityA<sub>i</sub>.length,&nbsp;cityB<sub>i</sub>.length &lt;= 10</code></li>\n\t<li><code>cityA<sub>i&nbsp;</sub>!=&nbsp;cityB<sub>i</sub></code></li>\n\t<li>所有字符串均由大小写英文字母和空格字符组成。</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 114,
"likes": 115,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"47.6K\", \"totalSubmission\": \"58K\", \"totalAcceptedRaw\": 47620, \"totalSubmissionRaw\": 57999, \"acRate\": \"82.1%\"}",
"stats": "{\"totalAccepted\": \"48.1K\", \"totalSubmission\": \"58.6K\", \"totalAcceptedRaw\": 48143, \"totalSubmissionRaw\": 58630, \"acRate\": \"82.1%\"}",
"hints": [
"Start in any city and use the path to move to the next city.",
"Eventually, you will reach a city with no path outgoing, this is the destination city."