CT1883

Leon and the Ruby parcels

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The inventory keeper Leon has been asked to recover the missing manifest. On the desk lies a long table of parcels readings. 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 <= 43; -1000000 <= a[i],x <= 1000000.

Example 1:

Input: 22 672478 718410 528306 66150 919926 726473 304322 -65192 -615081 -684034 -141010 180604 587723 4993 449401 595793 -706935 -609243 -103496 347140 -329185 -758110 182324
Output: 0

Example 2:

Input: 10 -996693 -694257 118640 -507373 -564269 34939 -60713 467213 217130 -296193 568508
Output: 0

Example 3:

Input: 6 -819922 976284 -829368 317515 -657868 630277 990794
Output: 0

Constraints:

1 <= n <= 43; -1000000 <= a[i],x <= 1000000.

Loading...
Test Cases:No test cases
No test cases available.
Leon and the Ruby parcels - EASY Coding Problem | CodeTikki