To keep the single quotes, which in my opinion make the code less cluttered and closer to the REPL, I use the pre-commit hook double-quote-string-fixer, in conjunction with black's option skip-string-normalization set to true.
std::unordered_set<T> values, newvalues;
values.insert(target);
auto k = 0;
while (values.size() > 0) {
k += 1;
for (auto v : values) {
for (auto d : denominations) {
if (v == d)
return k;
else if (v > d)
newvalues.insert(v - d);
else
continue;
}
}
swap(values, newvalues);
newvalues.clear();
}
return {};
}