We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
i cant pass some test cases, those with very long inputs, i dont know what to do!
here is my code: -
long arrayManipulation(long long int n, vector> queries) {
vector<long long int> v;
vector<long long int>v2;
long long int max;
for(long long int i=0;i<n;i++){
v.push_back(0);
}
for(long long int i=0;i<queries.size();i++){
for(long long int j=0;j<queries[i].size();j++){
v2.push_back(queries[i][j]);
}
for(long long int k=(v2[0]-1);k<v2[1];k++){
if(v[k]!=0){
v[k]+=v2[2];
}
else{
v[k]=v2[2];
}
}
v2.pop_back();
v2.pop_back();
v2.pop_back();
}
max=*max_element(v.begin(), v.end());
return max;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →
i cant pass some test cases, those with very long inputs, i dont know what to do! here is my code: -
long arrayManipulation(long long int n, vector> queries) {
}