Is there a heuristic or function to determine if two arrays of integers are alike or similar
There are many measures of similarity between sequences (or arrays or even strings), which one to use depends on the specific goals for the similarity. It may be the case that some trial and error is required to find the 'best' one. Therefore, I'll give a brief overview of some well-known similarity measures:

First, I consider distances most commonly associated with strings:


Edit distance: Here, we count minimum the number of 'edit operations' required to transform string $A$ into string $B$. These edit operations are usually inserting, deleting or substituting a single character in your string or array. Usually, the different operations have different costs. The Levenshtein distance is a special case of the edit distance that is commonly used to compare words.
Hamming distance: This distance simply counts the number of indices between two sequences that differ, which is the same method you described in your comment. This can at times be a decent metric, but it often doesn't come close to an our intuitive notion of 'similarity'.


There are many more string metrics, but those above are the most commonly known.

Next, you could also consider metrics over time series: here the sequences are interpreted as measurements at increasing time-steps. Usually, we assume there is some distance measure over the individual elements of your sequences, this can be taken as simply $d(x,y) = \begin{cases} 0 &amp; \text{if $x=y$}\\ 1 &amp; \text{if $x\neq y$}\end{cases}$, if you don't have a more reasonable notion of distance between your characters.


Dynamic Time Warping (DTW): This distance finds a suitable 'alignment' between the pair of sequence that minimizes the sum of the distances between the alignment. An advantage of this method is that this measure is insensitive to 'time shifts': The sequences $A=\langle 1, 2,3,4,5 \rangle$ and $B=\langle 0 ,1, 2,3,4\rangle$ have maximum Hamming distance, but a low DTW distance, as DTW is allowed to match the element $A[1]$ to $B[2]$, $A[2]$ to $B[3]$ and so on. Computing the DTW between two sequences takes $O(n^2)$ time (if both sequences have length $n$), but there are many faster approximations and heuristic speed-ups.
Longest Common Subsequence (LCS): This isn't always used as a similarity measure, but the length of a LCS between two sequences $A$ and $B$ can be seen as inversely proportional to the distance between $A$ and $B$ (i.e. long common subsequences mean high similarity). A disadvantage of this measure is that it often ignores too much of the relevant structure of the sequences, but it sometimes works fine.


Other similarity measures for time series can be found here.