Given two positive integers A, B, and an array D[] consisting only of digits [0-9], the task is to check if it is possible to… Read More

# Tag Archives: HashTable

Given a string S consisting of N characters and a positive integer K, the task is to count the number of substrings having at least… Read More

Given a Directed Tree consisting of N nodes, the task is to check if there exists a node in the given tree such that all… Read More

Given an array arr[] consisting of N integers and a positive integer M, the task is to find the number of array elements that occur… Read More

Given a positive integer N, the task is to print the nearest power of 2 of the frequencies of each digit present in N. If… Read More

Given an array arr[] consisting of N positive integers, the task is to find the nearest perfect power of 2 of the nearest perfect squares… Read More

Given an array arr[] consisting of N positive integers, the task is to find the sum of all array elements having a distinct count of… Read More

Given an array arr[] consisting of 2*N integers, the task is to check if it is possible to rearrange the array elements such that arr[2… Read More

Given a string S of size N consisting of K distinct characters and (N – K) ‘?’s, the task is to replace all ‘?’ with… Read More

Given an array arr[] consisting of N positive integers, the task is to find the count of unique pairs (i, j) such that the sum… Read More

Given an array arr[] consisting of N integers, the task is to count the minimum number of times at most K equal elements are required… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to make all array elements equal to K by repetedly… Read More

Given an array arr[] of size N, the task is to count the number of unique quadruples (a, b, c, d) from the array such… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to find the maximum number of pairs having sum K… Read More