Input Format
The first line of the input contains an integer .The next line contains  space separated integers(1-based index).The third line contains a single integer ,denoting the position of an element that should be removed from the vector.The fourth line contains two integers  and  denoting the range that should be erased from the vector inclusive of a and exclusive of b.

Output Format
Print the size of the vector in the first line and the elements of the vector after the two erase operations in the second line separated by space.

hackerrank vector erase problem solution in c++ programming

Vector Erase problem solution in C++ programming | HackerRank

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
    int size,pos,start,end,n,i,a,j;
        cout<<v[j]<<" ";
return 0;