Skip to content

Tag Archives: permutation

Given vector nums, the task is to print all the possible permutations of the given vector using backtracking Examples: Input: nums[] = {1, 2, 3}Output: {1,… Read More
Given an integer N., The task is to find the number of distinct permutations of length N, such that the bitwise AND value of each… Read More
Find the number of permutations of first N positive integers such that the sum of any two consecutive numbers is prime where all the cyclic… Read More
Given two integers N and K, the task is to find a permutation of first N natural numbers with exactly K inversions. Examples : Attention reader!… Read More
Given numeric string S of size N and a positive integer K, the task is to find the minimum number of adjacent swaps required in… Read More
Given an array arr[] of N integers, the task is to find the lexicographically largest permutation by sequentially inserting the array elements to the front… Read More
Given an array arr of size N, the task is to find the number of its permutations such that the sum of MEXs of its… Read More
Given four numbers N, L, R, and S, the task is to find a permutation of first N natural numbers(1-based indexing) having the sum as… Read More
Given two permutations arrays arr[] and brr[] of the first N Natural Numbers from 1 to N, the task is to find the absolute difference… Read More
Given two 2D binary arrays, a[][] and b[][] both of size M*N, the task is to pair each row in the array a[][] with any… Read More
Given two permutation arrays A[] and B[] of the first N Natural Numbers, the task is to find the minimum number of operations required to… Read More
Given an array arr[] consisting of N positive integers and an integer K, the task is to check if the array elements can be rearranged… Read More
Given an array arr[] of N distinct binary strings each having N characters, the task is to find any binary string having N characters such… Read More
Given a positive integer M and an array arr[] of size N and a few integers are missing in the array represented as -1, the… Read More
Given an integer K and an array arr[] having N pairwise distinct integers in the range [1, K], the task is to find the lexicographically… Read More

Start Your Coding Journey Now!