I'll show you count(v.begin(), v.end(), value) to get the number of times a specific value appears in a range. It returns an integer count of matching elements. You might use count_if for custom conditions: count_if(v.begin(), v.end(), [](int x) { return x % 2 == 0; }) counts how many even numbers exist in the vector.
Time complexity is since it checks each element. For maps, use the member function m.count(key) instead, which runs in due to the tree structure.