Given an array
$array = [ 0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0];
What is the quickest algorithm to group all the 0s and represent them as their starting and ending index?
(ie) Output of this should be (0,5),(10,17)...