Codes of the string

how to store string in vectors

use vectorv;
check this code

this is the question

make a global vector array
vectorans;

in the base case insert the generated string to vector
ans.push_back(str);

now in main() print the vector according to question
like this

int n = ans.size();

    cout<<"[ ";

    for(int i=0;i<n-1;i++){

        cout<<ans[i]<<", ";

    }

    cout<<ans[n-1]<< " ]";