1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree
https://leetcode.com/problems/check-if-a-string-is-a-valid-sequence-from-root-to-leaves-path-in-a-binary-tree/
Given a binary tree where each path going from the root to any leaf form a valid sequence, check if a given string is a valid sequence in such binary tree.
We get the given string from the concatenation of an array of integers arr and the concatenation of all values of the nodes along a path results in a sequence in the given binary tree.
Example 1:

Example 2:

Example 3:

Constraints:
1 <= arr.length <= 50000 <= arr[i] <= 9Each node's value is between [0 - 9].
Last updated
Was this helpful?