Strange Attribute Error!

Please help me out to solve this error…

In line 17, I think you should not call maxTree(root.val) as root.val is an integer not a node.
return max(root.val, max(maxTree(root.left), maxTree(root.right)))
This should work fine.

1 Like

thankyou !!

1 Like