How to take input in this problem?

As input can be string or integer, therefore we can’t always take input as integer data type

hello @mb129162
given input is in preorder format.
where true/false indicates whether left/right subtree exist or not.
if it is tree then recursively build the subtree otherwise return.

check this code snippet
image

This means that there will always be atleast 1 node in the tree

yeah u can assume that root node will always be there