The most straightforward solution is to count the total number of elements in the vector that have the specified value.
If the count is greater than zero, we've found our element.
This is simple to accomplish with the std::count function.
#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
...READ MORE
May 27, 2022
in Others
by
Damon
• 4,960 points
•
14,118 views