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)

```
This works:

```
myList
  .zipWithIndex
  .collect{case (x, n) if !indices.contains(n) => x}

```

Here's a complete, self-contained REPL transcript showing it working:

```
scala> case object Dog; case object Cat; case object Monkey; case object Mouse; case object Donkey
defined object Dog
defined object Cat
defined object Monkey
defined object Mouse
defined object Donkey

scala> val myList = List(Dog, Dog, Cat, Donkey, Dog, Donkey, Mouse, Cat, Cat, Cat, Cat)
myList: List[Product with Serializable] = List(Dog, Dog, Cat, Donkey, Dog, Donkey, Mouse, Cat, Cat, Cat, Cat)

scala> val indices = List(2, 7, 0)
indices: List[Int] = List(2, 7, 0)

scala> myList.zipWithIndex.collect{case (x, n) if !indices.contains(n) => x}
res1: List[Product with Serializable] = List(Dog, Donkey, Dog, Donkey, Mouse, Cat, Cat, Cat)

```

Note that I didn't use `toDropFromMylist`; that may mean I have misunderstood your question.