Here is the simplest solution i think


#1
vector<vector<int> > Solution::solve(int A) {
    vector<vector<int>> num(A);
    for(int line = 1;line<=A;line++){
        int c = 1;
        for(int i = 1;i<=line;i++){
            
            num[line-1].push_back(c);
            c = c*(line - i)/i;
        }
    }
    return num;
}