Sliding Window : ================== we need to make sure the window is Valid according to the problem statement 2 types of window window refers to Substring or SubArray 1. constant window in a window of size we need no of Unique elements in each window 1, 2, 2 , 3,4,5 k=3 2. Variable size window longest substring with out having duplicate characters str =geeksforgeeks eksforg The size of the window will varying we need to maintain 2 pointers start pointer and end pointer start=0; end=0 getyueksforgeeks tyue max=end-start+1 HashMap is empty end=2 start=0 t 1 y 1 u 1 will check e is there in the map or not you need to maintain one hashmap for(end=0;end hm=new HashMap<>(); for(end=0;end