Return type for this question should be "int", not Treenode


  • 0
    D

    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?


  • 0

    Why do you think we shall return just a val?


  • 0
    D

    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.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.