Impressing the Boss

  • + 0 comments

    my code code worked for many custom test cases . suggestions if any is appreciated

    include

    include

    using namespace std; int main(){ int row,count1=0,max1=0; cin>>row; vector> myvector(row); for(int i=0;i>col; myvector[i]=vector (col); for(int j=0;j>myvector[i][j]; }

    }
    for(int i=0;i<myvector.size();i++){
        for(int j=0;j<myvector[i].size()-1;j++){
            if(myvector[i][j]>myvector[i][j+1] || myvector[i][j+1]<max1 ){
                max1=myvector[i][j];
                count1++;
            }
        }
        if(count1>1)
        cout<<"NO\n";
    else
        cout<<"YES\n";
    }
    

    }