I have a list with values:
i_have = [1,1,1,4,4,4,4,4,4,4,1,1,1,1,4,4,4,4,3,3,4,3]
and I need to find the start and end indices for every chunk of the list with the value 4. If there's a 4 alone, like the second to last value of this list, its start and end indices should be the same.
i_need = [(3, 9), (14, 17), (20, 20)]
Can you help me with this?