Given an array, the task is to count the elements of array whose factors are less than the given number x.
Input: arr = [2, 12, 4, 6], x = 6
factors of x = 6 is [1, 2, 3]
factors of arr = 2 is 
factors of arr = 12 is [1, 2, 3, 4]
factors of arr = 4 is [1, 2]
factors of arr = 6 is [1, 2, 3]
so only arr and arr are the answer.
Find out factors of all the elements and that of given xand after that compare all of them if factors of elements are less than that of factors of x, then increment the count.
Below is the implementation of above problem –
- Check whether count of odd and even factors of a number are equal
- Count distinct elements in an array in Python
- Count frequencies of all elements in array in Python using collections module
- Make all elements of an array equal with the given operation
- Minimum number of steps to make all elements of array equal
- Python | Elements with Frequency equal K
- Python - Remove the row if all elements equal to N
- Find the number of operations required to make all array elements Equal
- Python - Count % K elements
- Python | Count unmatched elements
- Python | Matching elements count
- Python | Find all elements count in list
- Python - Count elements in tuple list
- Python | Count of elements matching particular condition
- Python | Count of common elements in the lists
- Python | Count of Matching i, j index elements
- Python | Count the elements till first tuple
- Python - Count elements in record tuple
- Python | Extend tuples by count of elements in tuple
- Python | Count the elements in a list until an element is a Tuple
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.