I just want a function that returns true if all the elements of a List[Integer] follow each other, i.e.
noGaps(List(3,4,5)) // true
noGaps(List(4,3,5)) // false
noGaps(List(3,4,6)) // false
I have something that works but it’s a bit verbose – what’s the most elegant solution?
How about this?