Hello Programmers, In this post, you will know how to solve the HackerRank Find Digits Solution. This problem is a part of the HackerRank Algorithms Series.HackerRank Find Digits SolutionOne more thing to add, don’t directly look for the solutions, first try to solve the problems of Hackerrank by yourself. If you find any difficulty after trying several times, then you can look for solutions.HackerRank Find Digits SolutionTaskAn integer d is a divisor of an integer n if the remainder of n % d =0.Given an integer, for each digit that makes up the integer determine whether it is a divisor. Count the number of divisors occurring within the integer.Examplen = 124Check whether 1, 2 and 4 are divisors of 124. All 3 numbers divide evenly into 124 so return 3.n = 111Check whether 1, 1, and 1 are divisors of 111. All 3 numbers divide evenly into 111 so return 3.n = 10Check whether 1 and 0 are divisors of 10. 1 is, but 0 is not. Return 1.Function DescriptionComplete the findDigits function in the editor below.findDigits has the following parameter(s):int n: the value to analyzeReturnsint: the number of digits in n that are divisors of n.Input FormatThe first line is an integer, t, the number of test cases.The t subsequent lines each contain an integer, n.Constraints1 <= t <= 150 < n < 109Sample Input2121012Sample Output23ExplanationThe number 12 is broken into two digits, 1 and 2. When 12 is divided by either of those two digits, the remainder is 0 so they are both divisors.The number 1012 is broken into four digits, 1, 0, 1, and 2. 1012 is evenly divisible by its digits 1, 1, and 2, but it is not divisible by 0 as division by zero is undefined.HackerRank Find Digits SolutionFind Digits Solution in C#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int main() { long long T, N, j, status, i, dig_divisor = 0; status = scanf("%lld\n", &T); for(i = 0; i < T; i++){ status = scanf("%lld\n", &N); j = N; while(j > 0){ if(j % 10 == 0){ j /= 10; continue; } if(N % (j % 10) == 0) dig_divisor++; j /= 10; } printf("%lld\n", dig_divisor); dig_divisor = 0; } /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0; }Find Digits Solution in Cpp#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <string> #include <algorithm> using namespace std; int getR(string n, int q) { if(!q) return 0; int r = 0; for(int i = 0;i < n.length();++i) { r *= 10; r += (n[i] - '0'); r %= q; } if(!r) return 1; return 0; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int T; string n; int res = 0; cin >> T; while(T--) { cin >> n; res = 0; for(int i = 0;i < n.length();++i) res += getR(n, n[i] - '0'); cout << res << endl; } return 0; }Find Digits Solution in Javaimport java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args){ int t; Scanner scan = new Scanner(System.in); t = scan.nextInt(); for(int i = 0; i < t; i++){ System.out.println(digits(scan.next())); } scan.close(); } private static int digits(String number) { int sum = 0; char[] digits = number.toCharArray(); for(int i = 0; i < number.length(); i++){ if(Character.getNumericValue(digits[i]) != 0){ if(((Integer.parseInt(number))% (Character.getNumericValue(digits[i]))) == 0){ sum++; } } else continue; } return sum; } }Find Digits Solution in Python# Enter your code here. Read input from STDIN. Print output to STDOUT inputLines = int(raw_input()) for i in range(inputLines): total = 0 number = int(raw_input()) temp = number while number > 0: if number%10 != 0 and temp%(number%10)==0: total += 1 number /= 10 print totalFind Digits Solution using JavaScriptfunction processData(input) { //Enter your code here var inputs=input.split('\n'); var numberOfTCs=inputs[0]; for(var i=1;i<=numberOfTCs;i++){ var num=Number(inputs[i]); var count=0; while(num!=0){ var digit=num%10; if(inputs[i]%digit==0) count++; num=Math.floor(num/10); } console.log(count); } } process.stdin.resume(); process.stdin.setEncoding("ascii"); _input = ""; process.stdin.on("data", function (input) { _input += input; }); process.stdin.on("end", function () { processData(_input); });Find Digits Solution in Scalaobject Solution { def main(args: Array[String]): Unit = { for (_ <- 0 until readInt()) { val n = readInt() val digits = "%d".format(n).map(c => (c - '0').toInt) println(digits.count(x => x != 0 && n % x == 0)) } } }Find Digits Solution in Pascalprogram find_point; var t, i, cnt, dig : integer; n, tmp : int64; begin readln(t); for i:=1 to t do begin readln(n); tmp:=n; cnt:=0; while ( tmp > 0 ) do begin dig:=tmp mod 10; if ( dig <> 0 ) and ( n mod dig = 0 ) then inc(cnt); tmp:=tmp div 10; end; writeln(cnt); end; end.Disclaimer: This problem (Find Digits) is generated by HackerRank but the Solution is Provided by BrokenProgrammers. This tutorial is only for Educational and Learning purposes.Next: HackerRank Sherlock and Squares Solution Post navigationHackerRank Taum and Bday Solution HackerRank Sherlock and Squares Solution