anagram
This commit is contained in:
parent
62d1558abe
commit
498f64b5cd
3 changed files with 35 additions and 24 deletions
|
|
@ -11,7 +11,7 @@ pub fn frequency(input: &[&str], worker_count: usize) -> HashMap<char, usize> {
|
|||
|
||||
thread::scope(|s| {
|
||||
let chunk_size = input.len().div_ceil(worker_count);
|
||||
let mut handles: Vec<_> = input
|
||||
let handles: Vec<_> = input
|
||||
.chunks(chunk_size)
|
||||
.map(|chunk| {
|
||||
s.spawn(move || {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue