I have some strings that have a specific duplicate word between them. I neet to join all these strings keeping the first "duplicated" word and remove the others.

Ex:

```scala
val p1 = "Hello John Doe"
val p2 = "Hello Jane Doe"
val p3 = "Hello Mary"

```

For the output, I'd pass the string to be removed, in this case "Hello" and would like to get a string (or a seq that I can later transform with `mkString(" ")`) with the contents `Hello John Doe Jane Doe Mary`.

The tricky part is that `.distinct` can't be used because it would remove the second "Doe" and it's not desired.