Strucutural Identical BT

How can I build the tree when string/bool value present in input?
For the integerate value i can treat -1 is false means null but how to take the input for two different data type integer and bool?

u can take all input as string array only. and check if the any string like if it is given 10 20 false.
then check if a string has all chars >=β€˜1’ and <=β€˜9’ then u can just create another int array where u can store it and store -1 for false… Just create another integer array and use that.
10 20 -1.
u can use stoi for it .