pull_all()
Removes all provided values from the given array.
Implementation
Args: array: The array to modify. values: The values to remove. Returns: A new list with the specified values removed.
Example
pull_all([1, 2, 2, 3, 3, 4], [2, 3])
Expected output: [1, 4]
Source Code
def pull_all(array: List[T], values: List[T]) -> List[T]:
return [x for x in array if x not in values]