Given three integers N, X, Y, and an array arr[] of size N, the task is to find the count of subarrays having at least… Read More

# Category Archives: Hash

Geek is a big fan of the Soccer League. Recently he has got a document containing the scores of all the matches played in the… Read More

Given an empty array A[] & Q queries of two types 1 and 2 represented by queries1 and queries2 respectively, the task is to find… Read More

Given a 3D array of size N*M*P consisting only of English alphabet characters, the task is to print the frequency of all the elements in… Read More

Given an array arr[], integer M and an array query[] containing Q queries, the task is to find the query[i]th occurrence of Mth most frequent… Read More

Given a string str of size N and two integers M and K (N is divisible by M), the task is to find the Kth… Read More

Given two strings str1 and str2, the task is to check if the two strings are isomorphic to each other. Two strings str1 and str2… Read More

Given an array arr[] of integers N, the task is to find the GCD of all numbers for which it’s value is equal to its… Read More

Given an integer array arr[] and a positive integer K, the task is to count all distinct pairs with differences equal to K. Examples: Input:… Read More

Given an array arr[] of size N and an integer K, the task is to minimize the value of the maximum element of the array… Read More

Given an array arr[] of size N, the task is to check if the array elements can be rearranged in a way such that the… Read More

Given an array arr[] of size N and an integer K, denoting the maximum value an array element can have, the task is to check… Read More

Given a singly linked list, the task is to Count the pairs of nodes with greater Bitwise AND than Bitwise XOR. Examples: Input: list: 1->4->2->6->3Output:… Read More

Given an array A[] having N positive integers, the task is to perform the following operations and maximize the sum obtained while reducing the array:… Read More

Given an array arr[] of length N, the task is to find the minimum number of operations to change the array such that each arr[i]… Read More