How can I remove all occurrences of a sublist from a list, eg
List(1, 2, 3, 4, 5, 6, 7, 4, 8, 9, 10, 5).removeSubList(4, 5)
should remove all o
Using Tzach Zohar idea with different implementation:
def removeSubList[T](list: List[T], sublist: List[T]): List[T] = if (list.containsSlice(sublist)) removeSubList(list.diff(sublist), sublist) else list