Skip to content

Category Archives: Hash

Given an array arr[] of size N consisting of only the first M natural numbers, the task is to find the minimum length of the… Read More
Given an array arr[] consisting of N integers, the task is to check if the sum of K most frequent array elements and the sum… Read More
Given an array arr[] consisting of N strings of lowercase characters and a character K such that any string may start with the character K,… Read More
Given an integer array arr[]. Create a new array which is a rotation of given array and find the maximum Hamming distance between both the… Read More
Given two strings str1 of size N and str2 of size M.The task is to find if it is possible to compose str2 by using… Read More
Given two binary arrays, A[] and B[] of size N respectively, the task is to find the number of elements in array A[] that will… Read More
Given an array arr[] consisting of N integers, the task is to find the number of pairs (i, j) whose sum of indices is the… Read More
Given an array arr[] consisting of N integers, the task is to find the minimum cost to sort the given array arr[] in ascending order… Read More
Given a sorted array, arr[] consisting of N integers, the task is to find the frequencies of each array element. Examples:  Input: arr[] = {1,… Read More
Given an array arr[] consisting of N positive integers such that arr[i] denotes the size of the ith group sitting in a donut shop and… Read More
Given an array arr[] of size N, the task is to find the maximum index i such that arr[i] is equal to i. If there… Read More
Given a binary tree, the task is to compress all the nodes on the same vertical line into a single node such that if the… Read More
Given an integer N, and the string integer M, the task is to find the total count to make N by using the digits of… Read More
Given an array, arr[] of N strings and a string T of size M, the task is to check if it is possible to make… Read More
Given an array arr[] of size N, the task is to count the number of subarrays having an average exactly equal to k. Examples: Input:… Read More