for (int i = 0; i < n; i++) // loop to take input of the elements of the array arr[i] = sc.nextInt(); int max_freq = 0; // variable to store the maximum frequency int num = 0; // variable to store the ...
pointsCover.put(num - k, pointsCover.getOrDefault(num - k, 0) + 1); pointsCover.put(num + k + 1, pointsCover.getOrDefault(num + k + 1, 0) - 1); ...