Problem
Input format
The first line contains the natural number `t`. The following lines contain `t` pairs of numbers `(a, b)`. - `1 <= t <= 100` - `0 <= a <= 999.999.999` - `0 <= b <= 9` - the subprogram `cif` must be defined explicitly and called from `main`
Output format
The program prints `t` lines, each containing the number of occurrences of digit `b` in `a`.
Example
4 12321 1 12321 2 12321 5 0 0
2 2 0 1
Stuck?
Use the Get Hint button in the action bar to reveal a guided hint.
💬 Discussion
Loading...No comments yet. Be the first to start the discussion!
Sample cases (from the problem)
Sample Case 1
4 12321 1 12321 2 12321 5 0 0
2 2 0 1
Solve it your way first
Community solutions unlock after you submit a passing solution. Don't peek.
Ready to solve this challenge?
Create a free account to write code, submit solutions, and track your progress.