fn counter(numbers: &Vec<i32>) -> HashMap<i32,usize> {
    let mut result = HashMap::new();
    for num in numbers.iter() {
        let count = result.entry(*num).or_insert(0);
        *count += 1;
    }
    result
}
/// Count occurances of a number, and return a map of the count.
///
/// # Examples
/// ```
/// let nums = vec![1,2,3,4,5,3,2,4,2,1,3];
/// let count = counter(&nums);
/// ```
Count occurances of a number, and return a map of the count.
Count occurances of a number and return a map of the count .
fn counter(numbers: &Vec<i32>) -> HashMap<i32,usize> {
    let mut result = HashMap::new();
    for num in numbers.iter() {
        let count = result.entry(*num).or_insert(0);
        *count += 1;
    }
    result
}
fn counter ( numbers : & Vec < i32 > ) -> HashMap < i32 , usize > { let mut result = HashMap :: new ( ) ; for num in numbers . iter ( ) { let count = result . entry ( * num ) . or_insert ( 0 ) ; * count += 1 ; } result }
Count occurances of a number, and return a map of the count.
Count occurances of a number and return a map of the count .
numbers
&Vec<i32>
numbers
&Vec<i32>
examples
None