(error in test case of value '5' )*** Error in `./solution': free(): invalid pointer: 0x0000000000bbd0d0 *** Aborted

google
Tags: #<Tag:0x00007f181c27de78>

#1

errror for custom test case of ‘5’ but no error for any other test case.
*** Error in./solution’: free(): invalid pointer: 0x0000000000bbd0d0 ***Aborted`

    vector<int> Solution::getRow(int A) {
      A=A+1;
       vector<vector<int>> b(A);
         vector<int> q(A,0);
      
          int row=1,i=0,j=0;
          
        
          if(A>=1)
          {
                b[0].push_back(1);
                //for row=0
          }

          while(row<A)
          {
          //for ith row ,number of element is i
                for(i=0;i<=row;i++)
                {
                      if(i==0)
                      {
                            b[row].push_back(b[row-1][0]);
                      }
                      else if(i==row)
                      {
                            b[row].push_back(b[row-1][row-1]);
                      }
                      else
                      {
                      b[row].push_back(b[row-1][i-1]+b[row-1][i]);
                      }
                }
                row++;
                i=0;
          }
          for(i=0;i<=A;i++)
          {
             q[i]=b[A-1][i];
          }
          return q;
    }