Given an array of pairs arr[][] of length N, and an array queries[] of length M, and an integer R, where each query contains an… Read More

# Category Archives: Algorithms

Given an array arr[] consisting of N strings where each string consists of ‘(‘ and ‘)’, the task is to check if a Regular Bracket… Read More

Given an array arr[] consisting of N pairs of items as {value, weight}, the task is to find the maximum sum of profit by choosing… Read More

Given an array arr[](1- based indexing) consisting of N integers and a positive integer K, the task is to find the minimum number of array… Read More

Given an array arr[] consisting of N integers and a positive integer X, the task is to count subsequences with GCD exactly X. Examples: Input:… Read More

Given an array arr[] of N integers and an integer K, the task is to find the sum of the difference between the maximum and… Read More

Given an array arr[] of N integers and an integer K, the task is to find the minimum number of operations required to sort the… Read More

Given two positive integers X and Y and N number of points arranged in a line, the task is to find the time required to… Read More

Given two strings str1 and str2 of same length N, the task is to check if there exists any permutation possible in any of the… Read More

Given an array of N integers the task is to select K elements out of these N elements in such a way that the minimum… Read More

Given an array arr, the task is to find the maximum sum of subsequence after flipping signs of at most K elements. Examples: Input: arr… Read More

Given an integer array arr[] of N integers, the task is to make each adjacent pair in the array co prime, by adding minimum number of… Read More

It’s time for the final exam in algorithms and data structures! Edsger prepared N sets of problems. Each set consists of problems in an increasing… Read More

Given an array arr[] consisting of N integers, the task is to find the minimum number of array elements that must be removed such that… Read More

Given an array A[] consisting of N intervals and a target interval X, the task is to find the minimum number of intervals from the… Read More