CT2252

Sable stamps Occurrence Count

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Asha runs the mill at the eel marshes of Slitherwick. Today the books show a list of stamps, and the numbers must be worked out before sundown. Task: Read n integers and a target x; print how many times x occurs. Input format: First line: n and x. Second line: n space-separated integers. Output format: Print the number of occurrences of x. Constraints: 1 <= n <= 76; 0 <= a[i],x <= 10.

Example 1:

Input: 23 1 7 9 1 2 8 6 8 6 3 7 4 4 8 3 0 3 8 4 1 8 10 10 0
Output: 2

Example 2:

Input: 65 8 1 4 2 3 4 0 9 10 3 10 4 5 8 3 10 0 9 5 7 6 0 7 1 3 3 2 0 0 1 6 9 3 10 8 2 4 2 9 8 0 8 6 7 1 5 8 3 3 8 10 9 10 0 4 3 6 9 5 2 4 2 4 10 8 7
Output: 7

Example 3:

Input: 14 9 5 10 3 5 6 9 3 7 7 1 7 3 4 4
Output: 1

Constraints:

1 <= n <= 76; 0 <= a[i],x <= 10.

Loading...
Test Cases:No test cases
No test cases available.
Sable stamps Occurrence Count - EASY Coding Problem | CodeTikki