Given a graph root, and a value K, the task is to find the number of nodes in the graph whose sum of neighbors is… Read More

# Tag Archives: HashSet

Given two arrays A[] and B[] of length N and M respectively, the task is to find the minimum number of insertions and deletions on… Read More

Given 3 arrays, arr[], brr[], and crr[], the task is to find the common elements in at least 2 arrays out of the given 3… Read More

Given two strings str1 and str2, the task is to find the minimum number of prefixes and suffixes of str2 required to form the string… Read More

Given an array arr[] consisting of N integers, the task for each array element is to find the absolute difference between the count of distinct… Read More

Given a queue consisting of the first N natural numbers and queries Query[][] of the type {E, X}, the task is to perform the given… Read More

Given an array of pairs arr[][] of the form {X, Y} such that each arr[i] represents the time X at which the candidate with candidate… Read More

Given two arrays A[] and B[] consisting of N integers where A[i] represents the initial position of the ith plane and B[i] is the speed… Read More

Given an array arr[] consisting of N distinct positive integers and a range [L, R], the task is to find the element in the given… Read More

Given an array arr[] consisting of N positive integers, the task is to find the number of pairs such that the Greatest Common Divisor(GCD) of… Read More

Given a string S consisting of N digits, the task is to find the number of distinct Prime Numbers that can be formed using the… 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 a number N, the task is to count the number of unique prime numbers that can be formed by deleting zero or more digits… Read More

Given an array arr[] consisting of N integers, the task is to find the largest number K (> 0) such that both the values K… Read More

Given an array arr[] consisting of (N – 1), the task is to construct a permutation array P[] consisting of the first N Natural Numbers… Read More