三天都写一写
写得满手是血
我好烂...姆咪...
def dfs(self, head, root):
    if head is None:
        return True
    if root is None:
        return False
    if head.val == root.val:
        return self.dfs(head.next, root.left) or self.dfs(head.next,
root.right)
    else:
        return False
def isSubPath(self, head: Optional[ListNode], root: Optional[TreeNode]) ->
bool:
    if root is None:
        return False
    elif self.dfs(head,root):
        return True
    else:
        return self.isSubPath(head,root.left) or
self.isSubPath(head,root.right)