Structurally identical(Binary Tree)

What’s wrong with my code?

@Sahilgohrisg in the input, “true” is a string, not a boolean value!

Thanks, Ishita! My code worked now. But how does it make a difference, if its bool or string, shouldn’t it work?

@Sahilgohrisg how do you expect the compiler to perform the conversion from a string to boolean?
All integer values except 0 are converted to boolean true, and 0 is converted to boolean false.