Question: What is the best way of removing element from a list by either a comparison to the second list or a list of indices.

```
val myList = List(Dog, Dog, Cat, Donkey, Dog, Donkey, Mouse, Cat, Cat, Cat, Cat)

val toDropFromMylist = List(Cat, Cat, Dog)

```

Which the indices accordance with myList are:

```
val indices = List(2, 7, 0)

```

The end result expected to be as below:

```
newList = List(Dog, Donkey, Dog, Donkey, Mouse, Cat, Cat, Cat)

```

Any idea?

Answer: 
Using `toDropFromMylist` is actually the simplest.

```
scala> myList diff toDropFromMylist
res0: List[String] = List(Dog, Donkey, Dog, Donkey, Mouse, Cat, Cat, Cat)

```
Something like this should do the trick:

```
myList
   .indices
   .filter(!indices.contains(_))
   .map(myList)

```