The idea is to use a resizable array (ArrayList in Java, vector in C) together with hashing. Resizable arrays support insert in Θ(1)
computer shortcut keys list
2 Articles
2
An Efficient Solution is to use the count of previous window, while sliding the window. The idea is to create a hash map that stores elements.