leetcode 113:路徑總和 II

類似於排列,使用遞歸的方式,運行時間12ms void path(TreeNode *root,int &sum,std::vector<std::vector<int>> &aa,std::vector<int> b){ if(root->left==NULL&&root->right==NULL&&sum==root->val) { b.push_back(root->
相關文章
相關標籤/搜索