pchf
Re:Django: Reformatted code with Black
on Tuesday February 08, 2022 @03:48PM (#30264464)
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.
Re:New trends in programming languages
on Monday November 25, 2019 @06:46AM (#21627243)
Right...with
template<typename T> optional<int> minimum_coins2(T target, std::vector<T> denominations) {
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 {};
}c++ 180ms, julia 270ms (using a value of 9070)