Given a string S consisting of N digits, the task is to print all possible combinations of the digits of the S that is a… Read More

# Tag Archives: permutation

Given a string S consisting of N characters and an array M[] of pairs of characters such that any character M[i][0] can be replaced with… Read More

Given a positive integer N, the task is to find the permutation of the first N natural numbers, say arr[] such that (arr[i] != i… Read More

Given an array arr[] consisting of N integers, the task is to find the permutation of array elements such that the sum of odd indices… Read More

Given an array arr[], consisting of N distinct positive integers and an integer K, the task is to find the lexicographically smallest permutation of the… Read More

Given two strings S1 and S2 consisting of N and M characters, the task is to check if the string S1 can be made equal… Read More

Given an array arr[] of size N, the task is to find the lexicographically smallest permutation of first 2*N natural numbers such that every ith… Read More

Given a positive integer N, the task is to construct a permutation of first N natural numbers such that the absolute difference between adjacent elements… Read More

Given an array arr[] consisting of (N – 1), the task is to construct a permutation array P[] consisting of the first N Natural Numbers… Read More

Given an array A[] consisting of N non-negative integers, and an integer K, the task is to find the number of ways ‘+’ and ‘-‘… Read More

Given an array p[] of size N representing a permutation of first N natural numbers, where N is an even number, the task is to… Read More

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