pofk_algorithm 0.0.3

A collection of efficient algorithms implemented in Rust for real-world projects.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[cfg(test)]
mod tests {
    use crate::set_algorithms::has_unique_window::has_unique_window;
    #[test]
    fn test_has_unique_window() {
        let arr = [1, 2, 3, 1, 4, 5];
        assert!(has_unique_window(&arr, 3));
        assert!(!has_unique_window(&arr, 4));
        let arr = [1, 2, 3, 4, 5];
        assert!(has_unique_window(&arr, 5));
        let arr: [i32; 0] = [];
        assert!(!has_unique_window(&arr, 1));
    }
}