title: Find the first appearance of a number in associative array
body: <p>Let's say the following is true:</p>
  
  <ul>
  <li>I have an associative array containing an unknown number of elements.</li>
  <li>The keys are integers, starting at <code>1</code>, and each is one more than the last.</li>
  <li>There is an element with key <em>N</em> whose value is <code>1</code>.</li>
  <li>The value of each element with a key less than <em>N</em> is <code>0</code>.</li>
  <li>The value of each element with a key greater than <em>N</em> is <code>1</code>.</li>
  </ul>
  
  <p>This is the array:</p>
  
  <p><a href="https://i.stack.imgur.com/sQrik.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sQrik.png" alt="enter image description here"></a></p>
  
  <p>The question is :
  <strong><em>What is the fastest/smartest way to find the position of the first '1' in the array?</em></strong></p>