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.
public static int findDigits(int n)
{
int divisors = 0;
int test = n % 10;
int remainder = n;
while (remainder > 0)
{
if (test != 0)
{
if (n % test == 0)
{
divisors++;
}
}
remainder /= 10;
test = remainder % 10;
}
return divisors;
}
Cookie support is required to access HackerRank
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 →
C# solution: