human
Remove minimum number of elements such that no common element exist in both array | To find no elements to remove so no common element exist.
To store count of array element.
Count elements of a.
Count elements of b.
Traverse through all common element , and pick minimum occurrence from two arrays.
To return count of minimum elements.
Driver Code"
How can the above be solved in Python?

Can you provide a code to remove minimum number of elements such that no common element exist in both array and the other steps required?
assistant
#Here is code to remove minimum number of elements such that no common element exist in both array and the other steps required.
 def minRemove ( 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
a = [ 1 , 2 , 3 , 4 ]
b = [ 2 , 3 , 4 , 5 , 8 ]
n = len ( a )
m = len ( b )
print ( minRemove ( a , b , n , m ) )