title: Check Array Contains Contiguous Integers Duplicates Allowed
signature: def check_array_contains_contiguous_integers_duplicates_allowed(arr, n):
source_py: def check_array_contains_contiguous_integers_duplicates_allowed(arr, n):
      max1 = max(arr)
      min1 = min(arr)
      m = ((max1 - min1) + 1)
      if (m > n):
          return False
      visited = ([0] * m)
      for i in range(0, n):
          visited[(arr[i] - min1)] = True
      for i in range(0, m):
          if (visited[i] == False):
              return False
      return True
source_cpp: bool check_array_contains_contiguous_integers_duplicates_allowed(vector<int> arr, int n) {
    int max = * max_element(arr.begin(), arr.end());
    int min = * min_element(arr.begin(), arr.end());
    int m = max - min + 1;
    if ( m > n ) return false;
    bool visited [ m ];
    memset ( visited, false, sizeof ( visited ) );
    for ( int i = 0;
    i < n;
    i ++ ) visited [ arr [ i ] - min ] = true;
    for ( int i = 0;
    i < m;
    i ++ ) if ( visited [ i ] == false ) return false;
    return true;
  }
question_info.test_code: import array
  import bisect
  import collections
  import datetime
  import functools
  import heapq
  import itertools
  import math
  import queue
  import re
  import string
  import sys
  from typing import Any, Dict, List, Optional, Set
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  def validate_solution(actual, expected):
      return actual == expected
  
  def driver(arr, n, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              arr, n),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver([2, 4, 19, 25, 65, 72, 75, 83, 90, 92], 8, False)
      print(f"TEST-0...{result}")
  
      result = driver([46, 2, 28, -44, 74, -36, -8, 30, -96, 60, 52, -58, 16, -38, 78, 38, -28, 16, 26, -42, 48, 40, 6, 72], 14, False)
      print(f"TEST-1...{result}")
  
      result = driver([0, 1, 1, 1], 2, True)
      print(f"TEST-2...{result}")
  
      result = driver([50, 21, 9, 29, 86, 2, 82, 49, 34, 18, 77, 83, 44, 67, 85, 58, 15, 85, 22, 3, 39, 67, 42, 37, 6, 35, 18, 57, 41, 32, 39, 30, 41, 68, 84, 36, 64, 36], 23, False)
      print(f"TEST-3...{result}")
  
      result = driver([-92, -82, -80, -78, -66, -66, -62, -58, -54, -52, -48, -30, -26, -22, -20, -20, -18, -14, -2, 12, 20, 24, 26, 26, 28, 28, 32, 36, 42, 48, 50, 52, 56, 64, 70, 72, 72, 80, 82, 84, 86, 92], 26, False)
      print(f"TEST-4...{result}")
  
      result = driver([1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0], 43, True)
      print(f"TEST-5...{result}")
  
      result = driver([18, 19, 21, 23, 30, 33, 38, 40, 45, 56, 63, 68, 93, 96], 8, False)
      print(f"TEST-6...{result}")
  
      result = driver([20, -90, -42, 48, 18, -46, 82, -12, -88, 82, 62, 24, 20, 64, -68, -34, -38, 8, -54, -20, -92, 34, -90, 78, 18, 8, -6, 10, 98, -24, 72, -92, 76, -22, 12, -44, 2, 68, -72, 42, 34, 20, -48], 34, False)
      print(f"TEST-7...{result}")
  
      result = driver([0, 0, 0, 0, 0, 1, 1, 1, 1], 8, True)
      print(f"TEST-8...{result}")
  
      result = driver([81, 25, 50, 48, 35, 38, 49, 21, 47, 94, 94, 55, 23, 45, 92, 23, 93, 33, 64, 9, 90, 64, 81, 17, 2, 73, 8, 7, 35, 36, 72], 27, False)
      print(f"TEST-9...{result}")
  
      sys.exit(0)
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.entry_fn_name: check_array_contains_contiguous_integers_duplicates_allowed
question_info.test_list: [{"idx": 0, "outputs": false, "inputs": {"arr": [2, 4, 19, 25, 65, 72, 75, 83, 90, 92], "n": 8}}, {"idx": 1, "outputs": false, "inputs": {"arr": [46, 2, 28, -44, 74, -36, -8, 30, -96, 60, 52, -58, 16, -38, 78, 38, -28, 16, 26, -42, 48, 40, 6, 72], "n": 14}}, {"idx": 2, "outputs": true, "inputs": {"arr": [0, 1, 1, 1], "n": 2}}, {"idx": 3, "outputs": false, "inputs": {"arr": [50, 21, 9, 29, 86, 2, 82, 49, 34, 18, 77, 83, 44, 67, 85, 58, 15, 85, 22, 3, 39, 67, 42, 37, 6, 35, 18, 57, 41, 32, 39, 30, 41, 68, 84, 36, 64, 36], "n": 23}}, {"idx": 4, "outputs": false, "inputs": {"arr": [-92, -82, -80, -78, -66, -66, -62, -58, -54, -52, -48, -30, -26, -22, -20, -20, -18, -14, -2, 12, 20, 24, 26, 26, 28, 28, 32, 36, 42, 48, 50, 52, 56, 64, 70, 72, 72, 80, 82, 84, 86, 92], "n": 26}}, {"idx": 5, "outputs": true, "inputs": {"arr": [1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0], "n": 43}}, {"idx": 6, "outputs": false, "inputs": {"arr": [18, 19, 21, 23, 30, 33, 38, 40, 45, 56, 63, 68, 93, 96], "n": 8}}, {"idx": 7, "outputs": false, "inputs": {"arr": [20, -90, -42, 48, 18, -46, 82, -12, -88, 82, 62, 24, 20, 64, -68, -34, -38, 8, -54, -20, -92, 34, -90, 78, 18, 8, -6, 10, 98, -24, 72, -92, 76, -22, 12, -44, 2, 68, -72, 42, 34, 20, -48], "n": 34}}, {"idx": 8, "outputs": true, "inputs": {"arr": [0, 0, 0, 0, 0, 1, 1, 1, 1], "n": 8}}, {"idx": 9, "outputs": false, "inputs": {"arr": [81, 25, 50, 48, 35, 38, 49, 21, 47, 94, 94, 55, 23, 45, 92, 23, 93, 33, 64, 9, 90, 64, 81, 17, 2, 73, 8, 7, 35, 36, 72], "n": 27}}]
question_info.entry_cls_name: Solution