Given the head of a linked list and the root of a binary tree, determine whether there exists a downward path in the binary tree corresponding to the sequence of values in the linked list.
A downward path starts at any node in the tree and travels continuously downwards to child nodes. Return true if such a path exists that contains all values of the linked list starting from head in consecutive order, and false otherwise.
Constraints:
The number of nodes in the tree is in the range
The number of nodes in the linked list is in the range
Node.val
Given the head of a linked list and the root of a binary tree, determine whether there exists a downward path in the binary tree corresponding to the sequence of values in the linked list.
A downward path starts at any node in the tree and travels continuously downwards to child nodes. Return true if such a path exists that contains all values of the linked list starting from head in consecutive order, and false otherwise.
Constraints:
The number of nodes in the tree is in the range
The number of nodes in the linked list is in the range
Node.val