I have a list
val l = List(1,2,3,2,6,4,2,3,4,2,1,3,6,3,2)
and I want to remove every instance of a particular sequence such as (2,3)
So the desired output is...
List(1,2,6,4,4,2,1,3,6,3,2)
What is the easiest/most idiomatic way to accomplish this in Scala?
I've tried doing this so far..
l.sliding(2).filter{ _!=List(2,3) }
but then I can't figure out to go from there, which made me wonder if I'm on the right track.