1367. Linked List in Binary Tree
## 思路
扫整个tree
用recursion检查tree_node跟lst_node
如果lst_node跑完就回传True
## Code
```python
class Solution:
def isSubPath(self, head: Optional[ListNode], root: Optional[TreeNode])
-> bool:
def check(tree_node, lst_node):
if not lst_node:
return True
if not tree_node:
return False
if tree_node.val != lst_node.val:
return False
return check(tree_node.left, lst_node.next) or
check(tree_node.right, lst_node.next)
queue = deque([root])
while queue:
node = queue.popleft()
if check(node, head):
return True
if node.left:
queue.append(node.left)
if node.right:
queue.append(node.right)
return False
```