How to find if vector contains specific value or not in C++, 씨쁠쁠 stl 벡터에 특정 값이 이미 있는지 확인하는 방법
std::find 함수를 써서 vector 의 시작부터 끝까지 확인해서 확인한다.
We can check if it has specific value using std::find function iterate from begin to the end.
if (find(targetVector.begin(), targetVector.end(), value) != targetVector.end()) {
// it has the value
}
else {
// it doesn't have that value
}