Structure of trees check problem

I’m failing one test case, what’s wrong?

hi @sounakume your checkStructure function is okay but your build function seems incorrect because the preorder traversal of both the trees is giving weird output. You failed this testcase:

50 true 25 true 12 false false false true 75 true 62 false false false
50 true 26 true 12 false false false true 75 true 62 false false false