Python Homework
Write a function that makes a list of intervals of a chosen number that appears consecutively in a list. Return indexes where the interval starts and ends. Simplified examples:
We chose number 1 that appears consecutively 3 times and then none and then 2 times again.
Input : [[1], [1], [1], [], [1], [1]]
Output : [[0, 2], [4, 5]]
We chose number 2 that appears once, none, once, none, and once.
Input : [[2], [], [2], [], [2]]
Output : [[0], [2], [4]]
We chose number 3 that appears consecutively 2 times, disappears, appears one, disappears, and appears twice
Input : [[3], [3], [], [], [], [3], [], [3], [3]]
Output : [[0, 1], [5], [7,8]]
Note that different numbers can be present in the lists. Intervals for number 1
Input : [[1,7,8], [6,7,1], [1,5,7], [6,7,8], [1,2,3], [1,2,3]]
Output : [[0, 2], [4, 5]]
About the recuiterMember since May 20, 2018 Aidan Swindells
from Sacatepequez, Guatemala