human
Count array elements whose all distinct digits appear in K | Function to the count of array elements whose distinct digits are a subst of the digits of K.
Stores distinct digits of K.
Iterate over all the digits of K.
Insert current digit into st.
Update K.
Stores the count of array elements whose distinct digits are a subst of the digits of K.
Traverse the array , arr [ ].
Stores current element.
Check if all the digits of arr [ i ] are present in K or not.
Iterate over all the digits of arr [ i ].
Stores current digit.
If digit not present in the st.
Update flag.
Update no.
If all the digits of arr [ i ] present in st.
Update count.
Driver Code"
Solution in Python:

What is a code to count array elements whose all distinct digits appear in K and the other steps required?
assistant
#Here is code to count array elements whose all distinct digits appear in K and the other steps required.
 def noOfValidKbers ( K , arr ) :
	st = { }
	while ( K != 0 ) :
		if ( K % 10 in st ) :
			st [ K % 10 ] = 1
		else :
			st [ K % 10 ] = st . get ( K % 10 , 0 ) + 1
		K = K // 10
	count = 0
	for i in range ( len ( arr ) ) :
		no = arr [ i ]
		flag = True
		while ( no != 0 ) :
			digit = no % 10
			if ( digit not in st ) :
				flag = False
				break
			no = no // 10
		if ( flag == True ) :
			count += 1
	return count
if __name__ == ' _ _ main _ _ ' :
	K = 12
	arr = [ 1 , 12 , 1222 , 13 , 2 ]
	print ( noOfValidKbers ( K , arr ) )