Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree