Tag Archives: permutation

Given a positive integer N, the task is to find a permutation of length N having Bitwise OR of any of its subarray greater than… Read More
Given an array, arr[] of size N denoting a permutation of numbers from 1 to N, the task is to count the number of inversions… Read More
Given a positive integer N, the task is to find the number of unique permutations of first N natural numbers having sum of the adjacent… Read More
Given two positive integers N and K, the task is to construct a permutation of the first N natural numbers such that all possible absolute… Read More
Given an array A[] of size N, containing a permutation of first N natural numbers and an integer K, the task is to find the… Read More
Given two positive integers K and N, the task is to find the permutation present at the middle of all permutations of at most length… Read More
Given two N-digit positive integers X and Y, the task is to find the minimum absolute difference between both the integers possible by rearranging the… Read More
Given an array arr[] consisting of N integers, the task is to find the lexicographically largest permutation of the given array possible by exactly one… Read More
Given an integer N, the task is to print all distinct permutations of the number N. Examples: Input: N = 133Output: 133 313 331Explanation:There are… Read More
Given a string S of length N, consisting of lowercase characters containing reordered English representations of digits [0 – 9], the task is to print… Read More
Given a binary string S, the task is to print all distinct decimal numbers that can be obtained by generating all permutations of the binary… Read More
Given a string S, the task is to print permutations of all words in a sentence. Examples: Input: S = “sky is blue”Output:  sky is… Read More
Given two arrays A[] and B[], both consisting of a permutation of first N natural numbers, the task is to count the minimum number of… Read More
Given an array arr[] consisting of N positive integers, the task is to find the permutation of first N natural numbers such that the given… Read More
Given an array arr[] consisting of N positive integers, the task is to find the maximum sum of Bitwise AND of same-indexed elements of permutation… Read More