//! Top K Frequent Elements (Generic, Hashable)
//!
//! Returns the k most frequent elements in the slice, in arbitrary order.
//!
//! # Type Parameters
//! * `T`: The element type. Must implement `Eq` + `Hash` + `Clone`.
//!
//! # Arguments
//! * `slice` - The slice to search.
//! * `k` - The number of top elements to return.
//!
//! # Returns
//! * `Vec<T>` - The k most frequent elements.
//!
//! # Example
//! ```rust
//! use pofk_algorithm::set_algorithms::top_k_frequent::top_k_frequent;
//! let arr = [1, 1, 1, 2, 2, 3];
//! let mut top = top_k_frequent(&arr, 2);
//! top.sort();
//! assert_eq!(top, vec![1, 2]);
//! ```
use HashMap;