• + 0 comments

    C#

        public static int findDigits(int n)
        {
            string nstr = n.ToString();
            int returnNum = 0;
            
            foreach (char c in nstr){
                int cur = c - '0';
                
                if (cur == 0){
                    continue;
                }
                
                if (n % cur == 0){
                    returnNum++;
                }
                
            }
            
            return returnNum;
        }