## Count of pairs in an array such that the highest power of 2 that divides their product is 1

Given an array arr[] of N positive integers. The task is to find the count of pairs (arr[i], arr[j]) such that the maximum power of… Read More »

## Sum of Digits of the Good Strings

A string is called good if it is made with only digits 0 to 9 and adjacent elements are different. The task is to find… Read More »

## Count non-adjacent subsets from numbers arranged in Circular fashion

Given that N people are sitting in a circular queue numbered from 1 to N, the task is to count the number of ways to… Read More »

## Generating all divisors of a number using its prime factorization

Given an integer N, the task is to find all of its divisors using its prime factorization. Examples: Input: N = 6 Output: 1 2… Read More »

## Number of K length subsequences with minimum sum

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 »

## Number of triangles that can be formed

Given a square with N points on each side of the square and none of these points co-incide with the corners of the square. The… Read More »

## Number of words that can be made using exactly P consonants and Q vowels from the given string

Given a string str and two integers P and Q. The task is to find the total count of words that can be formed by… Read More »

## Find a pair (n,r) in an integer array such that value of nCr is maximum

Given an array of non-negative integers arr[]. The task is to find a pair (n, r) such that value of nCr is maximum possible r… Read More »

## Count number of binary strings such that there is no substring of length greater than or equal to 3 with all 1’s

Given an integer N, the task is to count the number of binary strings possible of length N such that they don’t contain “111” as… Read More »

## Total ways of selecting a group of X men from N men with or without including a particular man

Given two integers X and N. The task is to find the total number of ways of selecting X men from a group of N… Read More »

## Count the number of subsequences of length k having equal LCM and HCF

Given an array Arr and an integer K. The task is to find the number of subsequences of size K such that the LCM and… Read More »

## Count of distinct graphs that can be formed with N vertices

Given an integer N which is the number of vertices. The task is to find the number of distinct graphs that can be formed. Since… Read More »

## Number of Subsequences with Even and Odd Sum | Set 2

Given an array arr[] of size N. The task is to find the number of subsequences whose sum is even and the number of subsequences… Read More »

## Ways to choose balls such that at least one ball is chosen

Given an integer N, the task is to find the ways to choose some balls out of the given N balls such that at least… Read More »

## Count permutation such that sequence is non decreasing

Given an array arr[] of integers, the task is to find the count of permutation of the array such that the permutation is in increasing… Read More »