Geeksforgeeks

Error

Given a vector of **N** positive integers and an integer **X**. The task is to find the **frequency **of X in vector.

**Example 1: **

**Input:**
N = 5
vector = {1, 1, 1, 1, 1}
X = 1
**Output: **
5
**Explanation: **Frequency of 1 is 5.

**Your Task:**

Your task is to complete the function **findFrequency**() which should count the frequency of X and return it.

We are replacing the old Disqus forum with the new Discussions section given below.

Click here to view old Disqus comments.

Click here to view old Disqus comments.

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

YesLoading...

Find the Frequency

...