CT2040

The Occurrence Count of Marigold Row

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the saffron fields of Marigold Row pays by the answer, and Nyssa intends to earn it. First: the full register of 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 <= 52; -1000000 <= a[i],x <= 1000.

Example 1:

Input: 18 -972753 -201256 -157689 -483542 -488128 519 -33183 -435109 -202825 -186373 -680975 -303816 -316125 -1716 -931117 -30766 -336371 -408345 -478702
Output: 0

Example 2:

Input: 37 -852955 -327371 -340768 -50605 -657869 -207759 -328766 -75388 -776103 -528837 -846971 -649141 -39122 -785644 -683486 -930648 -279149 -292291 -994740 -627487 -782515 -281599 -127162 -579070 -820424 -930425 -302092 -270278 -568087 -92715 -878297 -116768 -425725 -860172 -424177 -48160 -967245 -884410
Output: 0

Example 3:

Input: 21 -364349 -254457 -799986 -784478 -668480 -329852 -465261 -735247 -819525 -266007 -844825 -208137 -482387 -104514 -37561 -23013 -840564 -980559 -344418 -82579 -95429 -161057
Output: 0

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.