CT201

Frequency of the Chosen Seed

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Count exact matches for a chosen integer in a seed list. Task: Count occurrences of target x in the list. Input format: n, then n integers, then target x. Output format: One integer: the frequency. Constraints: 1 <= n <= 100000; -10^9 <= a[i],x <= 10^9 Edge rules: Apply the stated zero, tie, boundary, and ordering conventions exactly.

Example 1:

Input: 3 1 2 3 3
Output: 1

Example 2:

Input: 4 5 5 5 5 5
Output: 4

Example 3:

Input: 5 4 1 9 -2 6 9
Output: 1

Constraints:

1 <= n <= 100000; -10^9 <= a[i],x <= 10^9

Tags:

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