title: Remove Minimum Number Elements No Common Element Exist Array
signature: def remove_minimum_number_elements_no_common_element_exist_array(a, b, n, m):
source_py: def remove_minimum_number_elements_no_common_element_exist_array(a, b, n, m):
      countA = dict()
      countB = dict()
      for i in range(n):
          countA[a[i]] = (countA.get(a[i], 0) + 1)
      for i in range(n):
          countB[b[i]] = (countB.get(b[i], 0) + 1)
      res = 0
      for x in countA:
          if (x in countB.keys()):
              res += min(countA[x], countB[x])
      return res
source_cpp: int remove_minimum_number_elements_no_common_element_exist_array(vector<int> a, vector<int> b, int n, int m) {
    unordered_map < int, int > countA, countB;
    for ( int i = 0;
    i < n;
    i ++ ) countA [ a [ i ] ] ++;
    for ( int i = 0;
    i < m;
    i ++ ) countB [ b [ i ] ] ++;
    int res = 0;
    for ( auto x : countA ) if ( countB . find ( x . first ) != countB . end ( ) ) res += min ( x . second, countB [ x . first ] );
    return res;
  }
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(a, b, n, m, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              a, b, n, m),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver([4, 7, 10, 12, 12, 24, 29, 38, 45, 51, 53, 54, 59, 68, 72, 73, 85, 86, 88, 92, 92, 95], [7, 9, 17, 23, 25, 26, 29, 32, 35, 56, 56, 58, 59, 59, 62, 63, 72, 82, 85, 86, 95, 97], 15, 13, 3)
      print(f"TEST-0...{result}")
  
      result = driver([-6, 48, -70, 14, -86, 56, 80, -64, 64, -88, -14, 78, 14, -18, 52, 2, 22, 88], [-62, -58, 60, -30, 42, 8, 66, -48, -18, 64, -76, -90, -48, -90, -24, 64, -88, -98], 15, 9, 2)
      print(f"TEST-1...{result}")
  
      result = driver([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], 10, 10, 9)
      print(f"TEST-2...{result}")
  
      result = driver([10, 93, 2, 16, 36, 49, 36, 86, 6, 99, 95, 2], [99, 28, 7, 21, 62, 89, 82, 41, 43, 77, 8, 14], 6, 10, 0)
      print(f"TEST-3...{result}")
  
      result = driver([-98, -96, -80, -64, -42, -30, -6, 10, 62, 66, 82], [-62, -50, -42, 24, 44, 46, 52, 54, 60, 72, 72], 9, 6, 1)
      print(f"TEST-4...{result}")
  
      result = driver([1, 1, 0, 1, 1], [1, 1, 1, 0, 0], 4, 2, 4)
      print(f"TEST-5...{result}")
  
      result = driver([7, 11, 13, 15, 21, 33, 36, 39, 66, 99], [23, 36, 42, 44, 62, 65, 70, 78, 82, 89], 9, 9, 1)
      print(f"TEST-6...{result}")
  
      result = driver([-40], [-98], 0, 0, 0)
      print(f"TEST-7...{result}")
  
      result = driver([0, 0, 0, 0, 0, 0, 0, 0, 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], [0, 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, 1, 1, 1, 1, 1], 31, 26, 24)
      print(f"TEST-8...{result}")
  
      result = driver([79, 91, 31, 16, 28, 45, 37, 43, 73, 73, 76, 28, 71, 60, 64, 60, 99, 36, 47, 38, 65, 34, 22, 94, 84, 51, 72, 45, 71, 2], [58, 94, 12, 27, 98, 38, 75, 20, 94, 43, 32, 90, 23, 41, 88, 2, 62, 96, 53, 57, 48, 79, 6, 16, 11, 46, 73, 57, 67, 7], 18, 18, 1)
      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: remove_minimum_number_elements_no_common_element_exist_array
question_info.test_list: [{"idx": 0, "outputs": 3, "inputs": {"a": [4, 7, 10, 12, 12, 24, 29, 38, 45, 51, 53, 54, 59, 68, 72, 73, 85, 86, 88, 92, 92, 95], "b": [7, 9, 17, 23, 25, 26, 29, 32, 35, 56, 56, 58, 59, 59, 62, 63, 72, 82, 85, 86, 95, 97], "n": 15, "m": 13}}, {"idx": 1, "outputs": 2, "inputs": {"a": [-6, 48, -70, 14, -86, 56, 80, -64, 64, -88, -14, 78, 14, -18, 52, 2, 22, 88], "b": [-62, -58, 60, -30, 42, 8, 66, -48, -18, 64, -76, -90, -48, -90, -24, 64, -88, -98], "n": 15, "m": 9}}, {"idx": 2, "outputs": 9, "inputs": {"a": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1], "b": [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], "n": 10, "m": 10}}, {"idx": 3, "outputs": 0, "inputs": {"a": [10, 93, 2, 16, 36, 49, 36, 86, 6, 99, 95, 2], "b": [99, 28, 7, 21, 62, 89, 82, 41, 43, 77, 8, 14], "n": 6, "m": 10}}, {"idx": 4, "outputs": 1, "inputs": {"a": [-98, -96, -80, -64, -42, -30, -6, 10, 62, 66, 82], "b": [-62, -50, -42, 24, 44, 46, 52, 54, 60, 72, 72], "n": 9, "m": 6}}, {"idx": 5, "outputs": 4, "inputs": {"a": [1, 1, 0, 1, 1], "b": [1, 1, 1, 0, 0], "n": 4, "m": 2}}, {"idx": 6, "outputs": 1, "inputs": {"a": [7, 11, 13, 15, 21, 33, 36, 39, 66, 99], "b": [23, 36, 42, 44, 62, 65, 70, 78, 82, 89], "n": 9, "m": 9}}, {"idx": 7, "outputs": 0, "inputs": {"a": [-40], "b": [-98], "n": 0, "m": 0}}, {"idx": 8, "outputs": 24, "inputs": {"a": [0, 0, 0, 0, 0, 0, 0, 0, 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], "b": [0, 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, 1, 1, 1, 1, 1], "n": 31, "m": 26}}, {"idx": 9, "outputs": 1, "inputs": {"a": [79, 91, 31, 16, 28, 45, 37, 43, 73, 73, 76, 28, 71, 60, 64, 60, 99, 36, 47, 38, 65, 34, 22, 94, 84, 51, 72, 45, 71, 2], "b": [58, 94, 12, 27, 98, 38, 75, 20, 94, 43, 32, 90, 23, 41, 88, 2, 62, 96, 53, 57, 48, 79, 6, 16, 11, 46, 73, 57, 67, 7], "n": 18, "m": 18}}]
question_info.entry_cls_name: Solution