Sort by

recency

|

1679 Discussions

|

  • + 0 comments

    optimal approach but first requesting other learner to understand the code first

    function findDigits(n) {
        // Write your code here
        let num = n
        let cnt = 0
        
        while(num > 0){
            const lastDigi = num % 10
            if(lastDigi !== 0 && (n % lastDigi === 0)){
                cnt++
            }
            num = Math.floor(num/10)
        }
        return cnt
    }
    
  • + 0 comments

    Easy Solution

    def findDigits(Num:int):
        numbers = list(str(Num))
        count = 0
        
        for num in numbers:
            num = int(num)
            if num == 0:
                continue
            elif Num % num == 0:
                count += 1
        return count
    
  • + 0 comments

    A Teradata Performance DBA plays a crucial role in maintaining the efficiency of large-scale data environments by optimizing queries, monitoring system health, and ensuring smooth data flow. Just like a skilled DBA enhances performance behind the scenes, the Zenco dou delivers a refined experience for those who value smooth functionality in their lifestyle tools. Whether in tech or relaxation, performance and reliability matter—and that's where the Zenco duo makes its mark. Click Here:-https://kreativezen.com/products/zenco-duo

  • + 2 comments
    def findDigits(n):
        # Write your code here
        s =str(n)
        l=[]
        count=0
        for i in s:
            if int(i)!=0:
                l.append(int(i))
        
        for j in l:
            if  n%j==0:
                count+=1
        return count
    
  • + 0 comments

    Solution in TS

    function findDigits(n: number): number {
        let stringNumber = n.toString();
        let count = 0;
        
        for(let i = 0; i < stringNumber.length; i++){
            let tempNumber = parseInt(stringNumber.charAt(i));
            
            if(tempNumber != 0 && (n % tempNumber === 0)){
                count++;
            }
        }
        
        return count;
    }