1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! 🪟 Unique Sliding Window (Generic, Hashable)
//!
//! Returns true if there exists a window of size `k` in the slice with all unique elements.
//!
//! # Type Parameters
//! * `T`: The element type. Must implement `Eq` + `Hash`.
//!
//! # Arguments
//! * `slice` - The slice to search.
//! * `k` - The window size.
//!
//! # Returns
//! * `bool` - True if such a window exists, false otherwise.
//!
//! # Example
//! ```rust
//! use lunaris_engine::set::has_unique_window::has_unique_window;
//! let arr = [1, 2, 3, 1, 4, 5];
//! assert!(has_unique_window(&arr, 3));
//! assert!(has_unique_window(&arr, 4));
//! ```
use HashSet;