Update appNew update is available. Click here to update.
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
My Stats
EXP gained
yellow-spark
9560
Level
6 (Specialist)
Community stats
Discussions
0
Upvotes
0
Know more
393
Total problems solved
386
Easy
7
Moderate
0
Hard
0
Ninja
Jan Jan Feb Feb Mar Mar Apr Apr May May Jun Jun Jul Jul Aug Aug Sep Sep Oct Oct Nov Nov Dec Dec

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;

 

}

}

profile
Prashant Yadav
Published On 30-Nov-2023
72 views
0 replies
0 upvotes