Looking for a simple Java work
Budget: $10 – $30 USD
"Frequency of occurrence of a digit"
Your solution will be scored against some number of hidden test cases. A sample is provided below.
Find the frequency of occurrence of a given digit in all whole numbers between 0 and a given positive integer(both inclusive).
Let's say that the number to count (we'll call it K) is 2.
So, between 0 and 35, the K (in this case 2) appears 14times:
2, 12, 20, 21, 22 (twice), 23, 24, 25, 26, 27, 28, 29 32 = 14times
Input:
Input consists of 2 lines.
First line contains the number (K) which the program needs to count.
Second line contains the number N, which is the maximum number in the range to check for occurrences of K (for example, between 0 and N).
All number are positive whole numbers. There are no decimals or fractions.
Output:
Print the number of K's appearing between 0 and N (both inclusive).
Print O if not found.
Code evaluation based on output, please do NOT output anything else.
Sample Input :
2
35
Sample Output: 14
Your solution will be scored against some number of hidden test cases. A sample is provided below.
Find the frequency of occurrence of a given digit in all whole numbers between 0 and a given positive integer(both inclusive).
Let's say that the number to count (we'll call it K) is 2.
So, between 0 and 35, the K (in this case 2) appears 14times:
2, 12, 20, 21, 22 (twice), 23, 24, 25, 26, 27, 28, 29 32 = 14times
Input:
Input consists of 2 lines.
First line contains the number (K) which the program needs to count.
Second line contains the number N, which is the maximum number in the range to check for occurrences of K (for example, between 0 and N).
All number are positive whole numbers. There are no decimals or fractions.
Output:
Print the number of K's appearing between 0 and N (both inclusive).
Print O if not found.
Code evaluation based on output, please do NOT output anything else.
Sample Input :
2
35
Sample Output: 14