title: Count Minimum Number Subsets Subsequences Consecutive Numbers
signature: count_minimum_number_subsets_subsequences_consecutive_numbers <- function(arr, n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(arr, n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          list(3L, 7L, 7L, 11L, 14L, 14L, 14L, 16L, 17L, 17L, 21L, 22L, 24L, 27L, 27L, 27L, 31L, 33L, 35L, 36L, 36L, 37L, 38L, 43L, 45L, 49L, 52L, 54L, 57L, 59L, 59L, 60L, 67L, 73L, 74L, 74L, 74L, 75L, 75L, 79L, 83L, 87L, 90L, 93L, 97L), 42L, 
          34L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          list(-28L, 72L, 60L, 62L, 40L, 64L, 50L, -36L, -24L, 40L, -6L, 78L, -80L, -82L, 2L, -30L, 70L, 94L, -2L, -30L, 92L, 12L, -46L, 32L, -96L, -2L, 36L, -40L, -42L, 66L, 98L), 24L, 
          24L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          list(1L, 1L), 1L, 
          1L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          list(96L, 89L, 24L, 28L, 70L, 78L, 78L, 35L, 98L, 65L, 18L, 81L, 35L, 91L, 33L, 88L, 69L, 52L, 66L, 17L, 73L, 79L, 30L, 33L, 78L, 60L, 42L, 8L, 36L, 6L, 47L, 87L, 8L, 98L, 9L, 77L, 78L, 24L, 86L, 91L, 13L, 79L, 50L, 85L, 3L, 7L, 61L, 94L, 86L), 26L, 
          19L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          list(-92L, -92L, -90L, -84L, -78L, -66L, -60L, -60L, -46L, -42L, -38L, -32L, -24L, -20L, -18L, -16L, -14L, -10L, 0L, 4L, 6L, 12L, 24L, 32L, 34L, 44L, 48L, 50L, 50L, 64L, 66L, 68L, 80L, 84L, 86L, 86L, 88L, 90L, 90L, 90L, 92L, 94L, 96L, 98L, 98L), 42L, 
          42L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          list(0L, 1L, 1L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 1L, 1L, 1L, 0L, 1L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 0L, 0L, 0L), 27L, 
          26L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          list(8L, 12L, 13L, 14L, 16L, 20L, 20L, 21L, 23L, 23L, 24L, 27L, 29L, 29L, 29L, 29L, 35L, 35L, 38L, 39L, 40L, 46L, 50L, 52L, 60L, 62L, 62L, 65L, 65L, 65L, 70L, 71L, 72L, 73L, 75L, 76L, 80L, 81L, 82L, 83L, 85L, 91L, 95L, 97L, 98L, 98L), 29L, 
          23L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          list(-84L, 92L, 70L, -46L, 26L, -94L, -82L, -26L, -90L, -62L, 52L, 62L, -58L, 44L, -14L, -6L, 58L, 2L, 10L, 76L, -34L, 42L, -26L, 80L, 26L, 32L, -82L, 38L, 2L, 72L, 68L, 44L, 24L, 84L, -32L, 54L, -96L, -8L, 36L, 80L, -82L, 32L, 98L, -68L), 25L, 
          25L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          list(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, 1L), 21L, 
          20L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          list(64L, 10L, 6L, 3L, 67L, 95L, 72L, 96L, 72L, 30L, 99L, 21L, 46L, 23L, 48L, 38L, 48L, 50L, 53L, 91L, 59L, 58L, 27L, 95L, 63L, 20L, 27L, 22L, 58L, 3L, 11L, 75L, 77L, 64L, 46L, 1L, 67L, 79L, 6L, 46L, 57L, 79L, 49L, 83L, 21L, 36L, 44L), 46L, 
          36L
      )))
  
  }
  
  main()
source_py: def count_minimum_number_subsets_subsequences_consecutive_numbers(arr, n):
      x = sorted(arr)
      count = 1
      for i in range(0, (n - 1)):
          if ((x[i] + 1) != x[(i + 1)]):
              count = (count + 1)
      return count
source_cpp: int count_minimum_number_subsets_subsequences_consecutive_numbers(vector<int> arr, int n) {
    sort(arr.begin(), arr.end());
    int count = 1;
    for ( int i = 0;
    i < n - 1;
    i ++ ) {
      if ( arr [ i ] + 1 != arr [ i + 1 ] ) count ++;
    }
    return count;
  }