How to find the beginning and ending indices of groups of ones in a set of ones and zeros <p>How would I find the beginning and ending indices of the groups of ones. I've tried some convoluted attempts with nested if statements and have had no success. Is there an algorithm that deals with this type of problem or does it have a name. Thanks. </p> <pre><code>int arr[32] = {0,1,1,1,1,0,0,0, 1,1,1,0,0,0,0,0, 1,1,0,1,0,0,0,1, 0,0,0,0,0,1,1,1}; </code></pre>