• + 0 comments

    Hi, Do anyone know why my output is working properly on vs code and other editor but here output in stdout is empty.`vector dynamicArray(int n, vector> queries) { vector> arr(n,vector()); int lastAnswer = 0; int q_no = queries.at(0).at(1); vector res;

    for(int i=1; i<=q_no; i++){
        int query_typ = queries.at(i).at(0);
    
        int x = queries[i][1];
        int y = queries[i][2];
        int idx = (x^lastAnswer)%2;
    
        if(query_typ==1){
            arr[idx].push_back(y);
        } 
        else if(query_typ==2)
        {
            lastAnswer = arr[idx][y];
            res.push_back(lastAnswer);
        }
    
    }
    return res;
    

    }`