⭐ Pattern 1 — Fixed Window (foundation) 👉 Window size always = k 👉 Add right, remove left ✅ Must solve Maximum sum subarray of size k First negative number in window k Count distinct elements in window k Average of subarray size k Maximum number of vowels in substring k 1)class Solution { public int maxSubarraySum(int[] arr, int k) { //ok to solve optimal i can us slidinwinodw tehique int n = arr.length; int maxSum = Integer.MIN_VALUE; int currSum =0; int left =0; for(int right=0;right firstNegInt(int nums[], int k) { // write code here int n = nums.length; Listres = new ArrayList<>(); Dequedq = new ArrayDeque<>(); //see first i need to maintian window and add negtive into dq //then check if its empty we add list 0if not we add negtive and we laso ceh //when window moves we need to check if netive is there we need or update dq to get next negtives int left =0; for(int right=0;right