如何找到列表中某些元素列表中出现频率最高的位置?

How to find the most frequent places in list for certain list of elements?

例如有一个元素列表

[8,6,3,7,1,8,8,9,2,0,5,4,7,9,2,8,2,5,5,6,3,0,1,7,9,2,9,6,7,0,5,2,7,4,5,6,2,1,9,0,3,1,3,9,4,9,2,7,5,9,0,5,2,1,8,6,4]

我正在尝试在上面的列表中找到位置(索引)以找到第二个

[1,4,3,8]

是否有通用且优雅的算法?

这是使用绘图的简单视觉表示:

import matplotlib.pyplot as plt

lst = [8,6,3,7,1,8,8,9,2,0,5,4,7,9,2,8,2,5,5,6,3,0,1,7,9,2,9,6,7,0,5,2,7,4,5,6,2,1,9,0,3,1,3,9,4,9,2,7,5,9,0,5,2,1,8,6,4]
target = [1,4,3,8]
result = [0]*len(lst)

for i in range(len(lst)):
    if lst[i] in target:
        result[i] = 1

plt.step(range(len(lst)), result)
plt.show()

给出以下,相当容易分析的结果:

其中x-axis表示在列表中的索引,1表示在目标列表中,0不在目标列表中。