We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Implementation
- Find Digits
- Discussions
Find Digits
Find Digits
+ 5 comments IMO it's a mistake to grant 25 points for such an easy challenge.
+ 19 comments Here's a solution for Java without having to convert to and from String or Character arrays:
int n = in.nextInt(); int r = n; int count = 0; while(r > 0){ if(r % 10 != 0 && n % (r % 10) == 0) count++; r = r / 10; } System.out.println(count);
+ 3 comments 25 points? Seriously?
+ 12 comments 3 Lines of python. lololol.
for fluff in range(input()): value = int(raw_input()) print len([i for i in map(int, list(str(value))) if i != 0 and value % i == 0])
+ 8 comments I dont understand. Why do people post their solutions here? Everybody wants to get recognition or something? Discussion is about giving hints that will help to solution, not posting your answers...
Load more conversations
Sort 1323 Discussions, By:
Please Login in order to post a comment