MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / findDigits

Function findDigits

Hackerrank_problems/Find_digits/solution.cpp:6–20  ·  view source on GitHub ↗

Complete the findDigits function below.

Source from the content-addressed store, hash-verified

4
5// Complete the findDigits function below.
6int findDigits(int n) {
7//initialize an int to determine divisor
8int r =n;
9int count=0;
10
11while(r>0){
12// make a formula to get the target result
13 if(r % 10 != 0 && n % (r % 10) == 0) {
14 //count the unique numbers
15 count++;
16 }
17 r = r / 10;
18 }
19 return count;
20}
21
22int main()
23{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected