Try out every possible sum of two distinct elements within the sliding window.
Iterate through the HashMap, and for each element, check if there is another element in the map such that both together sum to the desired value.
Use the two-pointers technique on a sorted vector to find if such sum exists. Requires that the vector is kept sorted, which adds overhead.
It's possible to avoid having to sort the vector every time in approach 3. by using a balanced tree.
Run cargo bench
to see the running time of each solution with the inputs given.
Note that 100 is a very small number. It's very fast to process and sort such a small vector, so the Two Pointers technique ended up being the fastest here. The situation changes when we consider larger windows.