pub fn count_sum(&self, elements: &[T]) -> usize {
        // For some reason `sum` won't work here, so using explicit fold.
        elements.iter()
            .map(|e| self.count(e))
            .fold(0, |acc, x| acc + x)
    }
/// Return the sum of occurrences of a list of elements in the data.
///
/// # Examples
///
/// ```rust
/// use countrs::Counter;
/// let counter: Counter<u8> = "atgc".bytes().collect();
///
/// let count = counter.count_sum(b"gc");
/// assert_eq!(count, 2);
///
/// let count = counter.count_sum(&[b'g', b'c']);
/// assert_eq!(count, 2);
/// ```
Return the sum of occurrences of a list of elements in the data.
Return the sum of occurrences of a list of elements in the data .
pub fn count_sum(&self, elements: &[T]) -> usize {
        // For some reason `sum` won't work here, so using explicit fold.
        elements.iter()
            .map(|e| self.count(e))
            .fold(0, |acc, x| acc + x)
    }
pub fn count_sum ( & self , elements : & [ T ] ) -> usize { // For some reason `sum` won't work here, so using explicit fold. elements . iter ( ) . map ( | e | self . count ( e ) ) . fold ( 0 , | acc , x | acc + x ) }
Return the sum of occurrences of a list of elements in the data.
Return the sum of occurrences of a list of elements in the data .
&self
elements
&[T]
&self
elements
&[T]
examples
```rust
use countrs::Counter;
let counter: Counter = "atgc".bytes().collect().

let count = counter.count_sum(b"gc");
assert_eq!(count, 2).


` ` ` rust use countrs :: Counter ; let counter : Counter = " atgc " . bytes () . collect () . let count = counter . count_sum ( b " gc " ) ; assert_eq! ( count 2 ) .