title: Check if array has at least two elements with specific value
body: <p>Assume that I have an array with the following values: <code>0,1,0,0,0,1,0,1,1</code></p>
  
  <p>I am currently looping over my array and replacing 1's with 0's. However I would to break out of this loop if there are 2 1's left in my array. I don't really have much in terms of code but this is a stub of what I've been working on</p>
  
  <pre><code>if(//There are more than 2 1s ){
          return true; //carry on looping
      }
  
      return false; //break the loop
  </code></pre>
  
  <p>I have no idea how to differentiate between the 0's and the 1's and so I am quite confused with how to get this to work. Any ideas would be appreciated.</p>