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.
int main()
{
int N;
cin>>N;
vectorarr(N);
for(int i=0;i>arr[i];
}
int x;
cin>>x;
arr.erase(arr.begin()+x-1);
int a,b;
cin>>a>>b;
arr.erase(arr.begin()+a-1,arr.begin()+b-1);
cout<
return 0;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Vector-Erase
You are viewing a single comment's thread. Return to all comments →
this is my solution
include
using namespace std;
define ll long long
define vec vector
define all(x) x.begin(),x.end()
define yes cout<<"YES"< define no cout<<"NO"<int main() { int N; cin>>N; vectorarr(N); for(int i=0;i>arr[i]; } int x; cin>>x; arr.erase(arr.begin()+x-1); int a,b; cin>>a>>b; arr.erase(arr.begin()+a-1,arr.begin()+b-1); cout<
}