Q:

How to check if vector of string is balanced?

I have the following algorithm than check if string is balanced
bool IsBalanced(string input)
{
    int count = 0;
    for (int i = 0; i < input.size(); i++)
    {
        if (input[i] == '(') count++;
        if (input[i] == ')') count--;
        if (count < 0) return false;
    }
    if (count == 0) return true;
    return false;
}

How to use this method to check if vector<string> is balanced?
vector<string> VectorOfBalanced(vector<string> values) 
{
}

Sample Input:
values = { "{}[]()", "{[}]}" }

Sample Output
return = { "YES", "NO" }`

A:

How to use this method to check if vector is balanced?

you can use regular for loop, but in c++ we have more general algorithms like std::transform.
I assume your question is not whether IsBalanced is correct but how to apply it to vector of strings.
vector<string> res;
std::transform(
    values.begin(), values.end(), 
    std::back_inserter(res), 
    [](auto& s) -> auto { return IsBalanced(s) ? "Yes" : "No"; });

