Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list<int>& function1(list<int>& l)
- {
- int n = l.size();
- int i = 0;
- list<int>::iterator it = l.begin();
- while (it != l.end())
- {
- if (*it == n - i - 1)
- {
- it = l.erase(it);
- }
- else
- {
- ++it;
- }
- ++i;
- }
- return l;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement