mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 07:21:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一棵以 <code>root</code> 为根的二叉树和一个 <code>head</code> 为第一个节点的链表。</p>\n\n<p>如果在二叉树中,存在一条一直向下的路径,且每个点的数值恰好一一对应以 <code>head</code> 为首的链表中每个节点的值,那么请你返回 <code>True</code> ,否则返回 <code>False</code> 。</p>\n\n<p>一直向下的路径的意思是:从树中某个节点开始,一直连续向下的路径。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><strong><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/02/29/sample_1_1720.png\" style=\"height: 280px; width: 220px;\"></strong></p>\n\n<pre><strong>输入:</strong>head = [4,2,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]\n<strong>输出:</strong>true\n<strong>解释:</strong>树中蓝色的节点构成了与链表对应的子路径。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><strong><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/02/29/sample_2_1720.png\" style=\"height: 280px; width: 220px;\"></strong></p>\n\n<pre><strong>输入:</strong>head = [1,4,2,6], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]\n<strong>输出:</strong>true\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>head = [1,4,2,6,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]\n<strong>输出:</strong>false\n<strong>解释:</strong>二叉树中不存在一一对应链表的路径。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>二叉树和链表中的每个节点的值都满足 <code>1 <= node.val <= 100</code> 。</li>\n\t<li>链表包含的节点数目在 <code>1</code> 到 <code>100</code> 之间。</li>\n\t<li>二叉树包含的节点数目在 <code>1</code> 到 <code>2500</code> 之间。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 122,
|
||||
"likes": 123,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"17.5K\", \"totalSubmission\": \"41.1K\", \"totalAcceptedRaw\": 17452, \"totalSubmissionRaw\": 41126, \"acRate\": \"42.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"17.5K\", \"totalSubmission\": \"41.2K\", \"totalAcceptedRaw\": 17500, \"totalSubmissionRaw\": 41219, \"acRate\": \"42.5%\"}",
|
||||
"hints": [
|
||||
"Create recursive function, given a pointer in a Linked List and any node in the Binary Tree. Check if all the elements in the linked list starting from the head correspond to some downward path in the binary tree."
|
||||
],
|
||||
|
Reference in New Issue
Block a user