Count the factors of K present in the given Array | Function to find the count of factors of K present in array ; Loop to consider every element of array ; Driver Code ; Function Call
def calcCount ( arr , n , k ) : NEW_LINE INDENT count = 0 NEW_LINE for i in range ( 0 , n ) : NEW_LINE INDENT if ( k % arr [ i ] == 0 ) : NEW_LINE INDENT count = count + 1 NEW_LINE DEDENT DEDENT return count NEW_LINE DEDENT arr = [ 1 , 2 , 4 , 5 , 6 ] NEW_LINE n = len ( arr ) NEW_LINE k = 6 NEW_LINE print ( calcCount ( arr , n , k ) ) NEW_LINE