Yes, you are right about advancing the start of the window until uniqueness is restored. So, basically just advance it by 1.
You could definitely use two indexes instead of a queue, and using indexes over an array will be faster than using a queue.
You could definitely use two indexes instead of a queue, and using indexes over an array will be faster than using a queue.
No comments yet.