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....
The ‘=’ is an operator in C++ STL which copies (or moves) an unordered_map to another unordered_map and unordered_map::operator= is the corresponding operator function. There are three versions of this function....
Given an integer K and two arrays A1 and A2, the task is to return the total number of pairs (one element from A1 and one element from A2) with a sum equal to K....
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 N numbers, the task is to answer Q queries of the following type:...
Given an array of n string containing lowercase letters. Find the size of largest subset of string which are anagram of each others. An anagram of a string is another string that contains same characters, only the order of characters can be different. For example, “abcd” and “dabc” are anagram of each other....
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:...
Design the forward and backward buttons of a Browser using Stack Data Structure. If at any instance, the URL does not exist after pressing any of the two buttons, then print “Not Available”. Otherwise, print the current URL....