How to check if a list is a sublist(out of order list) of another list

l2 is not a sublist of l1.

But in general, sublist checking is quite easy to do.

def sublist?([], _), do: false
def sublist?(l1 = [_|t], l2) do
  List.starts_with?(l1, l2) or sublist?(t, l2)
end