educative.io

The purpose of the line not explained

In the solution what is the purpose of line 36 and 37.
if not root.data:
return max(left_subtree, right_subtree)

Hello @Ahnaf_Farhan,

Thank you for pointing out the specific lines in the code. It is greatly appreciated, as it helps improve the quality of the course for everyone. We have reviewed the code and made the necessary corrections.

Great job on paying attention to the details and for your eagerness to learn. I am confident that this feedback will help you excel in your future coding endeavours.

If you have any further questions or concerns, please don’t hesitate to reach out.

Happy Learning!

1 Like