New update is available. Click here to update.

1

Followers

0

Following

About

During my internship as a Software Engineer at PayNet Systems, I immersed myself in the dynamic realm ofFintech. My primary focus was on designing and developing RESTful APIs using Spring Boot—a pivot...

Noida Institute of Engineering & Technology 2023

Java - Default language

393

Total problems solved

386

Easy

7

Moderate

0

Hard

0

Ninja

Current streak:

10 days

Longest streak:

10 days

Less

More

Achievements

1

Ronin

Topics

Math

2

Ronin

Guided path

Oops in java

+ 1 more

1

Samurai

Guided path

Basics of java

Discussions

Approach for Count Digits

Interview problems

public class Solution {

public static int countDigits(int n){

// Write your code here.

//simply assign value into another variable and init a counter

int x = n,cnt=0;

while(x!=0){

int rem = x%10;

//check reather than rem doesn't equal to 0 and divide the given number

if(rem!=0 && n%rem==0)

cnt++;

x/=10;

}

//simply return counter

return cnt;

}

}