title: Find the missing integer in Codility
body: <pre><code>I need to "Find the minimal positive integer not occurring in a given sequence. "
    A[0] = 1    
    A[1] = 3    
    A[2] = 6
    A[3] = 4    
    A[4] = 1    
    A[5] = 2, the function should return 5.
  
  Assume that:
  
          N is an integer within the range [1..100,000];
          each element of array A is an integer within the range [−2,147,483,648..2,147,483,647].
  </code></pre>
  
  <p>I wrote the code in codility, but for many cases it did not worked and the performance test gives 0 %. Please help me out, where I am wrong.    </p>
  
  <pre><code>    class Solution {
      public int solution(int[] A) {
  
      if(A.Length ==0) return -1;
      int value = A[0];
      int min = A.Min();
      int max = A.Max();
      for (int j = min+1; j &lt; max; j++)
      {
        if (!A.Contains(j))
        {
            value = j;
            if(value &gt; 0)
            {
               break;
            }
        }
      }
  
      if(value &gt; 0)
      {
        return value;
      }
      else return 1;
    }
  }
  </code></pre>
  
  <p>The codility gives error with all except the example, positive and negative only values.</p>