Given an integer, for each digit that makes up the integer determine whether it is a divisor. Count the number of divisors occurring within the integer.

Example

Input => 124
Check whether 1,2 and 4 are divisors of 124. All 3 numbers divide evenly into 124 so return 3.

Input => 111
Check whether 1,1 and 1 are divisors of 111. All 3 numbers divide evenly into 111 so return 3.

Input => 10
Check whether 1 and 0 are divisors of 10.1 is but 0 is not so return 1.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *