title: Recursive search for character in array (Java)
body: <p>I was asked to write something that would determine if an array is a subset of another larger array. I've decided to start with a simpler problem and written a function that will determine if a character present in an array of characters.
  I've came up with this code:</p>
  
  <pre><code>private static boolean findSequenceRecHelper(char [] findIn, char c, int index) {
      boolean result = false;
      if(index&lt;findIn.length) {
          if(findIn[index] == c) {
              result = true;
          }
          else {
              findSequenceRecHelper(findIn,c,index+1);
          }
      }
      return result;
  }
  </code></pre>
  
  <p>I've done some debugging and found that the function iterates through the whole <code>char[]</code> array and when an element in array equals to desired value, <code>result</code> turns to <code>true</code>. But then again it turns to <code>false</code> and <code>false</code> is actually returned, which is incorrect.</p>
  
  <p>I can't find an error here - can someone please help me with this problem.</p>