Untitled

 avatar
unknown
plain_text
a month ago
288 B
3
Indexable
#include <iostream>
#include <list>
using namespace std;

int main(){
    list<int> l = {1, 3, 4, 2, 5};

    l.pop_back();
    l.pop_front();
    
    list<int>::iterator it = l.begin();
    advance(it, 2);
    l.erase(it);

    for (int i : l)
        cout << i << " ";
    return 0;
}
Editor is loading...
Leave a Comment