> map(A.remove, bb) Removing items from a list one at a time is O(len(list)) for each item removal. Filter() seems the better way to remove several items since it scans the list only once instead of len(bb) times.