Given an array arr[] consisting of N integers, the task is to find the maximum element with the minimum frequency....
Given an array arr[] consisting of N integers and a positive integer M, the task is to find the maximum frequency for each M-length subarray ( 0 < M ? N)....
Given an array arr[] of size N, the task is to count the number of subarrays from the given array, such that each distinct element in these subarray occurs at least twice....
Given an array of integers, replace every element by its frequency in the array....
Given a NxM matrix of integers containing duplicate elements. The task is to find the sum of all even occurring elements in the given matrix. That is the sum of all such elements whose frequency is even in the matrix....
Given two arrays A[] and B[] having n unique elements each. The task is to find the overlapping sum of the two arrays. That is the sum of elements that is common in both of the arrays....
Given an array of n integers, slope of a line i. e., m and the intercept of the line i.e c, Count the number of ordered pairs(i, j) of points where i ? j, such that point (Ai, Aj) satisfies the line formed with given slope and intercept....
Given an array of size n, the goal is to find out the smallest number that is repeated exactly ‘k’ times where k > 0? And Examples:...
LinkedHashMap is a predefined class in Java which is similar to HashMap, containing key and its respective value unlike HashMap, In LinkedHashMap insertion order is preserved. The task is to get the first and last entry present in LinkedHashMap. Iteration to get last and first value. The first and the last entry in Map is the entry that is inserted first and the entry that is to be inserted last where insertion order is preserved....
When elements get from the HashMap due to hashing the order they inserted is not maintained while retrieval. We can achieve the given task using LinkedHashMap. The LinkedHashMap class implements a doubly-linked list so that it can traverse through all the elements....
Given a string str of length N, the task is to find the minimum number of substrings required to be removed to make all the remaining characters of the string same....
Given a string of lowercase letters str of length N, the task is to reduce it by removing the characters which appear exactly K times in the string....