Basically lets say i have:
>>> a = [1,3,2,2,2]
>>> b = [1,3,2]
I want to see if the all the elements in b, exists within a, and in the same order. So for the above example b would exist within a.
I am kinda hoping theres a really simple one line answer.
This is a simple O(n * m) algorithm:
Note that is not the fastest way of doing this. If you need high performance you could use similar techniques to those used in string searching algorithms.