Giving wrong answer , vector size only one


#1

can anyone look into my solution why it is giving vectors of size = 1

    if((A->left==NULL) && (A->right==NULL)){
        if(A->val==B){
            return {true,{{A->val}}};
        }
        else return {false,{}};
    }
    vector<vector<int>> v_left,v_right;
    bool b_left = false,b_right = false;
    if(A->left){
        b_left = hasPathSum(A->left,B-A->val).first;
        if(b_left){
            v_left = hasPathSum(A->left,B-A->val).second; 
        }
    }
    if(A->right){
        b_right = hasPathSum(A->right,B-A->val).first;
        if(b_right){
            v_right = hasPathSum(A->right,B-A->val).second; 
        }
    }
    for(auto i : v_right){
        v_left.push_back(i);
    }
    for(auto i : v_left){
        i.insert(i.begin(),A->val);
    }
    if(b_left||b_right){
        return {true,v_left};
    }
    return {false,{}};

}

vector<vector<int> > Solution::pathSum(TreeNode* A, int B) {
    if(hasPathSum(A,B).first==false)return {};
    return hasPathSum(A,B).second;
}