Simplest C++ Solution for Kth Row


#1

vector Solution::getRow(int A) {
A++;
vectorp(A,1);
int x=1,y=1,z=1;
for(int i=3;i<=A;i++)
{
for(int j=1;j<i-1;j++)
{
x=y;y=p[j];
p[j]=x+y;
}
}
return p;
}
strong text