I\'d like to compute the similarity between two lists of various lengths.
eg:
listA = [\'apple\', \'orange\', \'apple\', \'apple\', \'banana\', \'ora
I believe what you are looking for is to counting the number of inversions in an array The question has your answer: Counting inversions in an array