Python - Grouped Consecutive Range Indices of Elements
Given List of elements, for list of tuples, where each represents the continuity of occurrence of each element. Input : test_list = [1, 1, 5, 6, 5, 5] Output : {1: [(0, 1)], 5: [(2, 2), (4, 5)], 6: [(3, 3)]} Explanation : 5 present at 2nd idx and also in continuation in 4th and 5th index, and hence