title: Find The First Missing Number
signature: class Solution {
  
      public Integer findTheFirstMissingNumber(ArrayList<Integer> array, Integer start, Integer end_arg2) {
source_py: def find_the_first_missing_number(array, start, end):
      if (start > end):
          return (end + 1)
      if (start != array[start]):
          return start
      mid = int(((start + end) / 2))
      if (array[mid] == mid):
          return find_the_first_missing_number(array, (mid + 1), end)
      return find_the_first_missing_number(array, start, mid)
source_cpp: int find_the_first_missing_number(vector<int> array, int start, int end) {
    if ( start > end ) return end + 1;
    if ( start != array [ start ] ) return start;
    int mid = ( start + end ) / 2;
    if ( array [ mid ] == mid ) return find_the_first_missing_number ( array, mid + 1, end );
    return find_the_first_missing_number ( array, start, mid );
  }
question_info.extension: java
question_info.entry_fn_name: findTheFirstMissingNumber
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 19, "inputs": {"array": [3, 6, 7, 9, 11, 14, 18, 30, 30, 32, 32, 34, 37, 44, 45, 45, 48, 48, 48, 52, 58, 60, 63, 67, 69, 69, 81, 83, 87, 89, 97, 99], "start": 24, "end_arg2": 18}}, {"idx": 1, "outputs": 19, "inputs": {"array": [88, -62, 16, 80, 66, 78, 88, 38, 52, -96, 48, 98, 96, -62, 18, 34, -58, 30, -10, 26, -98, 48, -96, 4, 92, 36, 36, -36, -32, -70, 62, -58, -58, -84, 86, -98], "start": 19, "end_arg2": 26}}, {"idx": 2, "outputs": 26, "inputs": {"array": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "start": 26, "end_arg2": 28}}, {"idx": 3, "outputs": 20, "inputs": {"array": [79, 99, 79, 85, 61, 58, 62, 61, 39, 87, 39, 74, 36, 70, 30, 43, 20, 52, 54, 50, 81, 98, 42], "start": 20, "end_arg2": 20}}, {"idx": 4, "outputs": 8, "inputs": {"array": [-98, -72, -46, -44, -42, -40, -16, -4, 62, 70, 74], "start": 8, "end_arg2": 10}}, {"idx": 5, "outputs": 24, "inputs": {"array": [1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], "start": 26, "end_arg2": 23}}, {"idx": 6, "outputs": 0, "inputs": {"array": [58], "start": 0, "end_arg2": 0}}, {"idx": 7, "outputs": 32, "inputs": {"array": [4, -84, -42, 12, -50, 42, -36, -38, -36, 98, -2, 20, 6, -96, -78, 24, 34, 88, 0, 74, 0, -8, -86, -68, -42, 98, -26, 86, -70, -32, -82, 78, 46, 58, 84, 4, -60, -90, -52, -78], "start": 37, "end_arg2": 31}}, {"idx": 8, "outputs": 28, "inputs": {"array": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "start": 28, "end_arg2": 28}}, {"idx": 9, "outputs": 0, "inputs": {"array": [8], "start": 0, "end_arg2": 0}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(ArrayList<Integer> array, Integer start, Integer end_arg2, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(array, start, end_arg2,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(new ArrayList<>(Arrays.asList(3, 6, 7, 9, 11, 14, 18, 30, 30, 32, 32, 34, 37, 44, 45, 45, 48, 48, 48, 52, 58, 60, 63, 67, 69, 69, 81, 83, 87, 89, 97, 99)), 24, 18, 19);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(88, -62, 16, 80, 66, 78, 88, 38, 52, -96, 48, 98, 96, -62, 18, 34, -58, 30, -10, 26, -98, 48, -96, 4, 92, 36, 36, -36, -32, -70, 62, -58, -58, -84, 86, -98)), 19, 26, 19);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)), 26, 28, 26);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(79, 99, 79, 85, 61, 58, 62, 61, 39, 87, 39, 74, 36, 70, 30, 43, 20, 52, 54, 50, 81, 98, 42)), 20, 20, 20);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-98, -72, -46, -44, -42, -40, -16, -4, 62, 70, 74)), 8, 10, 8);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0)), 26, 23, 24);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(58)), 0, 0, 0);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(4, -84, -42, 12, -50, 42, -36, -38, -36, 98, -2, 20, 6, -96, -78, 24, 34, 88, 0, 74, 0, -8, -86, -68, -42, 98, -26, 86, -70, -32, -82, 78, 46, 58, 84, 4, -60, -90, -52, -78)), 37, 31, 32);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)), 28, 28, 28);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(8)), 0, 0, 0);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(ArrayList<Integer> array, Integer start, Integer end_arg2, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(array, start, end_arg2),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__