Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
382 B
4
Indexable
Never
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <numeric>

using namespace std;

string FoldWithMinus(string left, string right) {
    return left + " -"s + right;
}

string AddStopWords(const string& query, const set<string>& stop_words) {
    return query + std::accumulate(stop_words.begin(), stop_words.end(), ""s, FoldWithMinus);
}