I have a question, I need to check if some array is part of greater array, it would be rather easy but I need to check if the greater array contains exact same sequence. For example
int[] greaterArray = {8, 3, 4, 5, 9, 12, 6 ... n - elements}
int[] lesserArray = {3, 4, 5}
Now I need to know if lesser array is part of this array but with same sequence so It it contains 3, 4, 5 next to each other in greater array.
I tried:
var exists = greaterArray.Intersect(lesserArray).Any();
But it return me information if any element of lesser array exists in greater array, not exact sequence. Any ideas?