Combinatorial - Hard Articles
Given an array arr[] of N integers and an integer M, the task is to find the number of non-empty subsequences such that the sum… Read More
Given an array arr[] of length N, the task is to find the overall sum of subsets of all the subsets of the array.Examples:   Input:… Read More
Given an array arr[] of size N and an integer K, the task is to find the number of K length subsequences of this array… Read More
Given a number N. The task is to find the number of ways you can draw N chords in a circle with 2*N points such… Read More
Given the mobile numeric keypad. You can only press buttons that are up, left, right or down to the current button or can choose to… Read More
Given an array arr[] of size N, the task is to generate and print all permutations of the given array. Examples: Input: arr[] = {1,… Read More
Given a tree with N nodes and a number K. Paint every node of the tree in one of the K available colors. Count and return… Read More
Given an N * N matrix arr[][] consisting of non-negative integers, the task is to find the number of ways to reach arr[N – 1][N… Read More
Given a string, generate all permutations of it that do not contain ‘B’ after ‘A’, i.e., the string should not contain “AB” as a substring.… Read More
Given two integers K and N, the task is to count the number of ways to arrange K different objects taking N objects at a… Read More
Given an array A[] containing N elements and an integer K. The task is to calculate the product of all elements of subsequences of size… Read More
Given a string S. The task is to count the non-overlapping pairs of palindromic sub-strings S1 and S2 such that the strings should be S1[L1…R1]… Read More
Given an NxN matrix, the task is to find the sum of bit-wise AND of all of its rectangular sub-matrices. Examples:   Input : arr[][] =… Read More
Given an N*N matrix containing only 0s and 1s, the task is to count the number of submatrices containing all 1s. Examples:   Input : arr[][]… Read More
Given an integer n and a range [l, r], the task is to find the count of total sub-sets of size n with integers from… Read More
Given two integers n and m, where n represent some paintings numbered from 1 to n and m represent some colours 1 to m with… Read More
Given a range represented by two positive integers l and r and two integers d and m. Find the count of numbers lying in the… Read More
Given a sum and a number . The task is to count all possible ordered pairs (a, b) of positive numbers such that the two positive integers… Read More
Given an array of N numbers and an integer K. The task is to print the number of unique subsequences possible of length K.  Examples:… Read More