## Number of handshakes such that a person shakes hands only once

There are N number of persons in a party, find the total number of handshake such that a person can handshake only once. Examples: Input… Read More »

- Java Program to print distinct permutations of a string
- Generating Lyndon words of length n
- Number of unique pairs in an array
- Sum of all Submatrices of a Given Matrix
- Count of Numbers in Range where first digit is equal to last digit of the number
- Count of sub-sets of size n with total element sum divisible by 3
- Count of Numbers in a Range divisible by m and having digit d in even positions
- Number of triangles that can be formed with given N points
- Count unordered pairs (i,j) such that product of a[i] and a[j] is power of two
- Total number of subsets in which the product of the elements is even
- Count of Numbers in a Range where digit d occurs exactly K times
- K length words that can be formed from given characters without repetition
- Count of Numbers in Range where the number does not contain more than K non zero digits
- Count the number of special permutations
- Permutations of string such that no two vowels are adjacent
- Number of permutations of a string in which all the occurrences of a given character occurs together
- Ways to paint N paintings such that adjacent paintings don't have same colors
- Number of trailing zeroes in base 16 representation of N!
- Arrange first N natural numbers such that absolute difference between all adjacent elements > 1
- Count pairs in an array such that LCM(arr[i], arr[j]) > min(arr[i],arr[j])
- Number of moves required to guess a permutation.
- Minimum and Maximum number of pairs in m teams of n people
- Python program to get all subsets of given size of a set
- Minimum numbers needed to express every integer below N as a sum
- Count ordered pairs of positive numbers such that their sum is S and XOR is K
- Ways to form n/2 pairs such that difference of pairs is minimum
- Count sub-sets that satisfy the given condition
- Maximum points of intersection n lines
- Ways to divide a binary array into sub-arrays such that each sub-array contains exactly one 1
- Number of ways to arrange a word such that all vowels occur together

There are N number of persons in a party, find the total number of handshake such that a person can handshake only once. Examples: Input… Read More »

Given an array of N integers. The task is to find the number of pairs (i, j) such that A[i] & A[j] is odd. Examples:… Read More »

Given N number of stairs. Also given the number of steps that one can cover at most in one leap (K). The task is to… 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 »

Given an array of positive integers(may contain duplicates) and a number ‘m’, find the number of unordered triplets ((Ai, Aj, Ak) and (Aj, Ai, Ak)… Read More »

We have a stick of length L. The stick got broken at (n-1) randomly chosen points (lengths of parts can be non-integer or floating point… Read More »

Let S be a finite partially ordered set. The size of a maximal antichain equals the size of a minimal chain cover of S. This… Read More »

Given an array of N integers and an integer M. You can change the sign(positive or negative) of any element in the array. The task… Read More »

Given three integers N, M and X, the task is to find the number of ways to form an array, such that all consecutive numbers… Read More »

Given a sequence of N elements, only three operations can be performed on any element at most one time. The operations are: Add one to… Read More »

Given N numbers, find the number of permutations in which the sum of elements at odd index and sum of elements at even index are… Read More »

Given N and K. The task is to find out how many different ways are there to represent N as the sum of K non-zero… Read More »

Given a binary string and k, to check whether it’s contains all permutations of length k or not. Examples: Input : Binary string 11001 k… Read More »

Given two positive integers N and K. The task is to find the number of arrays of size N that can be formed such that… Read More »

Given a number n, the task is to find the nth hexadecagonal number. A Hexadecagonal number is class of figurate number and a perfect squares.… Read More »