I'm looking at the Python version, which shows "rtype: Treenode", but since we need to return root.val, not root, that should be int, no?
Why do you think we shall return just a val?
Interesting -- it passes in both cases -- whether you return a node or its value. Probably should be one or the other. Or if we really want to accept either, that should be indicated in the rtype line.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.