Given a Binary Tree, the task is to construct an array such that ith index of the array contains GCD of all the nodes present… Read More

# Category Archives: Hash

Given a sorted array arr[] consisting of N positive integers and an integer D, the task is to find the number of triplets (i, j,… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to print all possible unique quadruplets (arr[i], arr[j], arr[k], arr[l])… Read More

Given an array arr[] of size N, the task is to find the index in the given array where the sum of the prime numbers… Read More

Given an array arr[] consisting of N distinct integers, the task is to convert the given array into a sequence of first N non-negative integers,… Read More

Given an array arr[] consisting of N positive integers, the task is to find an index from the array having count of prime numbers present… Read More

Given a string S consisting of N characters (representing the tasks to perform) and a positive integer K, the task is to find the minimum… Read More

Given string S consisting of lowercase and uppercase letters, the task is to find the number of substrings having the equal number of lowercase and… Read More

Given an array arr[] consisting of N integers, the task is to count the number of distinct pairs (arr[i], arr[j]) in the array such that… Read More

Given a string S consisting of N characters (representing the tasks to perform) and a positive integer K, the task is to find the minimum… Read More

Given a string S of length N, the task is to find the SHA-512 Hash Value of the given string S. Examples: Input: S =… Read More

Given a string S of size N, consisting of digits [0 – 9] and character ‘.’, the task is to print the string that can… Read More

Given an array arr[] consisting of N integers, the task is to find the number of pairs such that the GCD of any pair of… Read More

Given two graphs G1 and G2, the task is to find the union and intersection of the two given graphs, i.e. (G1 ∪ G2) and… Read More

Given an array arr[] consisting of N integers, the task is to print the smaller of the two subsets obtained by splitting the array into… Read More