I have two arrays. A contains an ordered list of elements, such as [e1, e2, e2, e3, e4, e5, e5]
. B is a subset of A, with repeats, such as [e1, e1, e2, e5, e4]
. In practice the arrays will be larger than this (probably under 10,000 elements in length), and performance matters.
How can I quantitatively determine how similar the order of elements in the two arrays are? (Ideally without just brute forcing a comparison)