You are viewing a single comment's thread. Return to all comments →
Java solution:
public static int findDigits(int n) { String strN = String.valueOf(n); int count = 0; for (char c : strN.toCharArray()) { int d = Integer.parseInt(String.valueOf(c)); if (d != 0 && n % d == 0) count++; } return count; }
Seems like cookies are disabled on this browser, please enable them to open this website
Find Digits
You are viewing a single comment's thread. Return to all comments →
Java solution: