Sort by

recency

|

1689 Discussions

|

  • + 0 comments

    Python 3

    def findDigits(n):
        num = list(filter(lambda x: x != 0, list(map(int, str(n)))))
        d = 0
        for i in num:
            if n % i == 0:
                d += 1
        return d
    
  • + 0 comments

    Python3 solution

    def findDigits(n):
        # Write your code here
        count = 0
        c = n
        while c > 0:
            x = c % 10
            if x == 0:
                c = c//10
                continue
            if n % x == 0:
                count += 1
            c = c // 10
        return count
    
  • + 0 comments

    Python3 Solution

    def findDigits(n):
        res = 0
        staticN = n
        while n > 0:
            divider = n % 10
            if divider != 0 and staticN % divider == 0:
                res += 1
            n //= 10
        
        return res
    
  • + 0 comments

    Here is find digits solution in python, java, c++, c and javascript - https://programmingoneonone.com/hackerrank-find-digit-problem-solution.html

  • + 0 comments
    num = n
    
    result = 0
    while num > 0:
        d = num%10
        num = int(num / 10)        
        if d == 0:
            continue
        if n % d == 0:
            result+=1
    return result