• + 1 comment

    If you dont mind me asking you, could you explain why you do this:

    if(n==1){
    string str;
    cin>>str;
    stk.push(st);  // why push the string onto the stack when its 
    //empty? why not after  (st+=str) cause then this would append to the string?
    st+=str;
    }