I have a Main List and a Sub List and I want to locate the indices of every occurrence of the Sub List that are found in the Main List, in this example, I want the following list of indices returned.
>>> main_list = [1,2,3,4,4,4,1,2,3,4,4,4]
>>> sub_list = [4,4,4]
>>> function(main_list, sub_list)
>>> [3,9]
Ideally, the function should also ignore fragments of the sub_list, in this case [4,4] would be ignored. Also, I expect the elements to all be single digit integers. Here is a second example, for clarity:
>>> main_list = [9,8,7,5,5,5,5,5,4,3,2,5,5,5,5,5,1,1,1,5,5,5,5,5]
>>> sub_list = [5,5,5,5,5]
>>> function(main_list, sub_list)
>>> [3,11,19]