title: Find Index Of An Extra Element Present In One Sorted Array
signature: find_index_of_an_extra_element_present_in_one_sorted_array <- function(arr1, arr2, n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(arr1, arr2, n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(arr1, arr2, n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(1L, 6L, 7L, 10L, 11L, 12L, 12L, 16L, 17L, 29L, 32L, 33L, 35L, 35L, 45L, 49L, 52L, 56L, 57L, 58L, 61L, 62L, 63L, 64L, 68L, 71L, 71L, 77L, 79L, 79L, 81L, 82L, 82L, 83L, 83L, 89L, 89L, 93L, 94L, 94L), list(3L, 12L, 13L, 14L, 15L, 17L, 18L, 19L, 22L, 24L, 28L, 29L, 33L, 37L, 41L, 42L, 44L, 49L, 51L, 51L, 52L, 53L, 56L, 56L, 59L, 60L, 64L, 64L, 67L, 70L, 71L, 78L, 83L, 88L, 88L, 90L, 92L, 93L, 93L, 95L), 36L, 
          0L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(-48L, -92L, 96L, -18L, 10L, -24L, -4L, 96L, -16L, -78L, 4L, -80L, -96L, -28L, -78L, 68L, 2L, -60L, 0L), list(-38L, -40L, -50L, 50L, -26L, -80L, 64L, 54L, 74L, -44L, -40L, -92L, -16L, 4L, -60L, -42L, -60L, -74L, 38L), 16L, 
          0L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(1L), list(0L), 0L, 
          0L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(68L, 98L, 21L, 29L, 71L, 49L), list(97L, 90L, 25L, 89L, 57L, 41L), 3L, 
          0L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-80L, -76L, -76L, -76L, -68L, -66L, -56L, -44L, -38L, -28L, -24L, -10L, 8L, 14L, 16L, 18L, 24L, 26L, 30L, 32L, 50L, 64L, 76L, 80L, 90L, 94L, 94L, 94L), list(-90L, -88L, -66L, -60L, -48L, -48L, -46L, -42L, -40L, -36L, -26L, -4L, 2L, 4L, 4L, 8L, 16L, 18L, 34L, 50L, 52L, 56L, 64L, 80L, 86L, 90L, 92L, 96L), 14L, 
          0L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(0L, 0L, 1L, 0L, 1L, 0L, 1L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 0L, 1L, 0L, 1L, 0L, 1L, 0L, 1L, 1L, 1L, 0L, 1L), list(0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L), 22L, 
          2L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(3L, 7L, 16L, 17L, 20L, 22L, 29L, 32L, 34L, 34L, 35L, 40L, 40L, 40L, 41L, 46L, 49L, 58L, 60L, 62L, 63L, 64L, 64L, 68L, 70L, 73L, 76L, 79L, 83L, 86L, 90L, 92L, 99L), list(4L, 4L, 7L, 13L, 23L, 23L, 25L, 25L, 26L, 34L, 38L, 39L, 39L, 45L, 48L, 50L, 52L, 54L, 58L, 59L, 60L, 65L, 72L, 76L, 80L, 80L, 80L, 84L, 87L, 90L, 92L, 94L, 96L), 26L, 
          0L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(18L, -68L, -6L, -32L, -76L, -86L, -8L, 76L, -46L, 20L, -80L, 54L, -88L, -58L, -48L, -66L, -66L, 18L, -28L, -74L, -72L, -26L, -92L, -78L, 24L, -22L, -80L, -80L, 82L, -2L, -72L, -88L, -54L, -84L, -8L), list(-30L, 96L, 92L, -12L, -14L, -68L, -16L, 20L, 74L, -42L, 36L, 84L, -82L, 66L, 44L, 70L, -92L, -56L, -28L, -68L, -4L, 10L, -4L, 90L, 72L, 84L, 68L, 14L, 32L, 60L, 40L, 60L, -34L, 58L, -56L), 17L, 
          0L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), list(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), 24L, 
          24L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(74L, 75L, 52L, 58L, 34L, 53L, 51L, 45L, 34L, 28L, 53L, 94L, 10L, 20L, 23L, 12L, 95L, 78L, 48L, 11L), list(62L, 56L, 17L, 1L, 11L, 30L, 59L, 18L, 99L, 21L, 86L, 49L, 24L, 85L, 25L, 56L, 21L, 66L, 23L, 96L), 17L, 
          0L
      )))
  
  }
  
  main()
source_py: def find_index_of_an_extra_element_present_in_one_sorted_array(arr1, arr2, n):
      for i in range(0, n):
          if (arr1[i] != arr2[i]):
              return i
      return n
source_cpp: int find_index_of_an_extra_element_present_in_one_sorted_array(vector<int> arr1, vector<int> arr2, int n) {
    for ( int i = 0;
    i < n;
    i ++ ) if ( arr1 [ i ] != arr2 [ i ] ) return i;
    return n;
  }