Sort by

recency

|

1656 Discussions

|

  • + 0 comments

    Here is my c++ solution, you can watch the explanation here : https://youtu.be/iTxLvVxH5pY

    int findDigits(int n) {
        int result = 0, original = n;
        while(n){
            int d = n % 10;
            if(d != 0 && original % d == 0) result ++;
            n /= 10;
        }
        return result;
    }
    
  • + 0 comments
    int dividers = 0 ; 
            int digit = 0 ;
            int originalNumber =n;
            try{    
                while(n != 0){
                    digit = n % 10;
                    if(digit != 0 &&originalNumber%digit==0)
                        dividers++;
                    n = n/10;
                }
                
            }catch(Exception exception){
                System.out.println(exception);
            }
            return dividers;
    
  • + 0 comments

    Python

    return len([1 for i in str(n) if int(i) if not n% int(i)])

  • + 0 comments
    def findDigits(n):
        count_d = 0
        for i in str(n):
            try:
                if n%int(i) == 0:
                    count_d +=1
            except:
                pass
        return count_d
    
  • + 0 comments

    My entry:

    return len([x for x in list(map(int, str(n))) if x != 0 and n % x == 0])