Use Push/Keep/Pull algorithm.
Possible implementation of removeAt.