## Check if B can be formed by permuting the binary digits of A

Given two integer A and B, the task is to check whether the binary representation of B can be generated by permuting the binary digits… Read More »

## Find permutation array from the cumulative sum array

Given an array arr[] of N elements where each arr[i] is the cumulative sum of the subarray P[0…i] of another array P[] where P is… Read More »

## Increasing permutation of first N natural numbers

Given a permutation {P1, P2, P3, ….. PN) of first N natural numbers. The task is to check if it is possible to make the… Read More »

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

Given an array of non-negative integers arr[], the task is to find a pair (n, r) such that nPr is maximum possible and r ≤… Read More »

## Find the possible permutation of the bits of N

Given an integer N, the task is to find whether the bits of N can be arranged in alternating manner i.e. either 0101… or 10101….… Read More »

## Find the permutation of first N natural numbers such that sum of i % Pi is maximum possible

Given a number N. The task is to find the permutation P of first N natural numbers such that sum of i % Pi is… Read More »

## Distinct permutations of a string containing duplicates using HashSet in Java

Given a string str that may contain duplicate characters, the task is to print all the distinct permutations of the given string such that no… Read More »

## Find permutation with maximum remainder Sum

Given an integer N, the task is to find a permutation of the integers from 1 to N such that is maximum. Examples: Input: N… 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 »

## Count number of permutation of an Array having no SubArray of size two or more from original Array

Given an array of distinct integer A, the task is to count the number of possible permutations of the given array A[] such that the… Read More »

## Print all the permutation of length L using the elements of an array | Iterative

Given an array of unique elements, we have to find all the permutation of length L using the elements of the array. Repetition of elements… Read More »

## Iterative program to generate distinct Permutations of a String

Given a string str, the task is to generate all the distinct permutations of the given string iteratively. Examples: Input: str = “bba” Output: abb… Read More »

## Euler zigzag numbers ( Alternating Permutation )

Euler Zigzag numbers is a sequence of integers which is a number of arrangements of those numbers so that each entry is alternately greater or… Read More »

## Lexicographically largest permutation of the array such that a[i] = a[i-1] + gcd(a[i-1], a[i-2])

Given an array arr[] of size N (N > 2). The task is to find lexicographically largest permutation of the array such that arr[i] =… Read More »

## Find the count of M character words which have at least one character repeated

Given two integers N and M, the task is count the total words of M character length formed by the given N distinct characters such… Read More »