I have a problem. I need to write a function that returns the number of times k occurs in v. How do I make it return the number of times k occurs in v? This is what I have so far.
int countOccurrences(const vector<int> & v, int k);
for (int i = 0; i < v.size(); ++i)
{
if (v[k] == v[i + 1])
}