Short Problem Definition:
You are given an integer N. Find the digits in this number that exactly divide N (division that leaves 0 as remainder) and display their count. For N=24, there are 2 digits (2 & 4). Both of these digits exactly divide 24. So our answer is 2.
time complexity is O(N);
space complexity is O(1)
Just follow the problem description. The problem can be optimized by creating a map of digits and their counts.