My answer is very clean


  • -14
    G

    class Solution {
    public:
    vector<int> vec;
    vector<int> postorderTraversal(TreeNode* root) {

        if(root==NULL)
        return vec;
        postorderTraversal(root->left);
        postorderTraversal(root->right);
         vec.push_back(root->val);
        return vec;
    }
    

    };


Log in to reply
 

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