Might be because of space complexity


#1

vector Solution::getRow(int B) {
int A=B+1;
vector<vector >result(A);
result[0].push_back(1);
result[1].push_back(1);
result[1].push_back(1);
if(B<=1)
return result[B];
else
{
for(int i=2;i<A;i++)
{
result[i].push_back(1);
for(int j=1;j<i;j++)
{
result[i].push_back(result[i-1][j-1]+result[i-1][j]);

      }
      result[i].push_back(1);
  }
  
  
  
}

return result[A-1];

}