Given two numbers N and K, the task is to find the count of all valid combinations of at most K numbers that sum up… Read More
Category Archives: Combinatorial
Given an integer N, consider an array having elements in the range [0, N-1] such that the maximum Bitwise XOR of all adjacent pairs is… Read More
Given a binary string s and an array ct[] of even size. The task is to minimize the cost of operations to: Convert string s… Read More
Given two integers A and B, the task is to find a triplet (X, Y, Z) such that all of them are divisible by A,… Read More
Given two strings A and B each of length N and an integer K, the task is to find if string A can be converted… Read More
Given a numeric string S, the task is to find the maximum length of a subsequence having its left rotation equal to its right rotation.… Read More
Given an array of pairs v[][] of size N which shows the score of the match at N instances where (v[i][0], v[i][1]) shows a score… Read More
Given a ternary string S consisting of only three characters, the task is to find the count of ordered triplets (i, j, k) such that… Read More
Given two integers N and M (1 ≤ N, M ≤ 100) denoting the total number of 1s and 0s respectively. The task is to… Read More
Given an integer N denoting the number of elements, the task is to find the number of ways to divide these elements equally into groups… Read More
Given an integer array arr[] of size N and a positive integer K, the task is to count all the pairs in the array with… Read More
Given a String ph[], the task is to find the absolute difference of consecutive elements and insert the result in between the consecutive elements. By… Read More
Given two integers N(denoting number of ‘1’) and M(denoting number of ‘0’). The task is to maximize the number of “001” or “110” patterns that… Read More
Given N and M number of points on the straight line, denoting the positions of the customers and vendors respectively. Each vendor provides service to… Read More
Given an array speed[] of size N denoting the speed of N cars moving on an infinitely long single lane road (i.e. no overtaking is… Read More