Skip to content

Tag Archives: permutation

Given an array arr[] of length n, the task is to find the minimum number of operations required to make a permutation of integers 1… Read More
Given a positive integer X, the task is to find a permutation of length X such that all subarray sum of length greater than one… Read More
Given an array arr[] of size N, the task is to find the minimum cost required to convert a given array into a permutation from 1… Read More
Given N, the task is to determine the count of all permutations of size 2N having at least N-increasing elements. An element pi of a… Read More
Given a positive integer N, the task is to find the count of squads of positive integers (A, B, C, D) such that (A *… Read More
Given an unsorted permutation array of size N and an integer K ( 1 ≤ K ≤ N ), the task is to sort this… Read More
Given the integers N and X, the task is to find the smallest lexicographical permutation a[], using all integers [1, N] such that a[i]%i is… Read More
Given an array A[] of size N where each element A[i] =max(P[0], P[1], . . ., P[i]), where P[] is a permutation consisting of elements… Read More
Given an array A[] of size N, find the permutation of array A such that the array B[] which is formed by taking the GCD… Read More
Given a positive integer N, the task is to construct a permutation from 1 to N such that the absolute difference of elements is in… Read More
Given a permutation of first N positive integers, the task is to form the lexicographically smallest permutation such that the new permutation does not have… Read More
Given a string str consisting of N letters, the task is to find the total number of strings that can be generated by replacing each… Read More
Given integers N and K, the task is to find the number of possible arrangements of N people around a circular table such that K… Read More
Given two integers S and X representing the sum and bitwise XOR respectively of two integers, the task is to find the count of all… Read More
Given an integer N and an array arr[] of M pairs of type (Ai, Bi), the task is to generate the lexicographically smallest possible permutation… Read More