title: Algorithm that finds the start and the finish of many sub-arrays?
body: <p>so I have this question in C:</p>
  
  <p>Given an array that only contains 0's and 1's (Example: <code>[1,1,0,0,0,0,1,0,1,0,1,1]</code>).
  I need to find the start of a "ring interval" and the finish of the same "ring interval" (there could be many rings like that, we'll have to store the start and finish of each one in a matrix of 2 columns)</p>
  
  <p>"Silence" is when at least two 0's are next to each other. (in the given array, the sub array <code>[0,0,0,0]</code> is silent.</p>
  
  <p>"Ring interval" is when Silence doesn't occur. (example in the given array, the sub array <code>[1,1]</code> (first 2 values), and the sub array <code>[1,0,1,0,1,1]</code> (the end of the array)).</p>
  
  <p>So we'll have to store <code>[0,1]</code> in the first row of the matrix.
  then <code>[6,11]</code>. since the second sub array starts at the 6th index and ends at the 11th.</p>
  
  <p>I can't seem to describe it any better, it's in a different language and quite a bit more complicated than this.. i hope you understand!</p>
  
  <p>Examples:
  Array = <code>[0,0,0,0,1,0,1,1,1,0,0,0,1,0,0]</code>
  Matrix would be : <code>[4,8] [12,12]</code></p>
  
  <p>Array = <code>[1,0,0,1,1]</code>
  Matrix would be : <code>[0,0] [3,4]</code></p>
  
  <p>Thank you!</p>