title: Get count from array using recursion
body: <p>I need to get the count of numbers less than the first integer in an array using recursion. I am given a function definition as </p>
  
  <pre><code>public static int countGreaterThanFirst(int[]
  numbers, int startIndex, int endIndex, int firstNumber){}
  </code></pre>
  
  <p>I am not supposed to use a loop or global/static variable. How can I convert my implementation below to satisfy the two conditions above. I have recently asked <a href="https://stackoverflow.com/questions/36285176/recursive-function-without-loop/36285677#36285677">another</a> similar question but this is a bit different due to the need to keep track of the count variable. If someone can help, I will really appreciate. 
  Below is my implementation with a loop.</p>
  
  <pre><code>public static int countGreaterThanFirst(int[] numbers, int startIndex, int endIndex, int firstNumber) {
      int greater_than_first = 0;
      for (int count = startIndex; count &lt;= endIndex; count++) {
          if (numbers[count] &gt; firstNumber) {
              greater_than_first++;
          }
      }
      return greater_than_first;
  }
  </code></pre>