我想用伪代码执行以下操作:
(a, b, c) = (HashSet(...), HashSet(...), HashSet(...))
(a, b, c) = (a - b - c, b - a - c, c - a - b)
Run Code Online (Sandbox Code Playgroud)
在 Rust 中我尝试了这样的事情:
(a, b, c) = (HashSet(...), HashSet(...), HashSet(...))
(a, b, c) = (a - b - c, b - a - c, c - a - b)
Run Code Online (Sandbox Code Playgroud)
现在我们要从这些HashSets 中排除所有常见的“单词”。我了解到difference方法union返回Difference和Union迭代器。如果我这样做:
fn get_random_set(...) -> HashSet<String> {
...
}
// Sets of randomly generated …Run Code Online (Sandbox Code Playgroud)