## Print k different sorted permutations of a given array

Given an array arr[] containing N integers, the task is to print k different permutations of indices such that the values at those indices form… Read More »

- Samsung Semiconductor Institute of Research(SSIR Software) Intern/FTE | Set-2
- Walmart Labs Interview Experience ( On Campus FT + 6 month Internship )
- Java Program to print distinct permutations of a string
- Generating Lyndon words of length n
- Program to calculate the value of nCr Efficiently
- Number of unique pairs in an array
- Count of Numbers in Range where first digit is equal to last digit of the number
- Sum of all Submatrices of a Given Matrix
- Count of Numbers in a Range divisible by m and having digit d in even positions
- Count of sub-sets of size n with total element sum divisible by 3
- Sum of bitwise AND of all submatrices
- Count unordered pairs (i,j) such that product of a[i] and a[j] is power of two
- Number of triangles that can be formed with given N points
- Sum of Bitwise-OR of all Submatrices
- Count the number of special permutations
- Total number of subsets in which the product of the elements is even
- Count of Numbers in a Range where digit d occurs exactly K times
- Sum of (maximum element - minimum element) for all the subsets of an array.
- Count of Numbers in Range where the number does not contain more than K non zero digits
- K length words that can be formed from given characters without repetition
- Permutations of string such that no two vowels are adjacent
- Number of permutations of a string in which all the occurrences of a given character occurs together
- Count Numbers with N digits which consists of odd number of 0's
- Ways to paint N paintings such that adjacent paintings don't have same colors
- Number of trailing zeroes in base 16 representation of N!
- Number of submatrices with OR value 1
- Arrange first N natural numbers such that absolute difference between all adjacent elements > 1
- Deletions of "01" or "10" in binary string to make it free from "01" or "10"
- Number of moves required to guess a permutation.
- Minimum and Maximum number of pairs in m teams of n people

Given an array arr[] containing N integers, the task is to print k different permutations of indices such that the values at those indices form… Read More »

Given an integer N, the task is to find the number of trailing zeroes in the base 16 representation of the factorial of N. Examples:… Read More »

Given a NxN 2-D matrix, the task to find the sum of all the submatrices. Examples: Input : arr[] = {{1, 1}, {1, 1}}; Output… Read More »

There arises several situations while solving a problem where we need to iterate over all possible combinations of an array. In this article, we will… Read More »

Given a set, write a Python program to generate all possible subset of size n of given set within a list. Examples: Input : {1,… Read More »

Given a string str, the task is to print all the distinct permutations of str. A permutation is an arrangement of all or part of… Read More »

Given the number of ‘X’ and ‘Y’ in a string which consists of characters from the set {‘X’, ‘Y’}, the task is to find the… Read More »

Give an integer array arr[] consisting of elements from the set {0, 1}. The task is to print the number of ways the array can… Read More »

Given an integer n and a range [l, r], the task is to find the count of total sub-sets of size n with integers from… Read More »

Given two integers N and M, the task is to count the number of simple undirected graphs that can be drawn with N vertices and… Read More »

Given an integer N. The task is to find the permutation of first N natural numbers such that the absolute difference between any two consecutive… Read More »

Given an array of N elements, the task is to find all the unique pairs that can be formed using the elements of a given… Read More »

Given two integers n and m, where n represent some paintings numbered from 1 to n and m represent some colours 1 to m with… Read More »

Given an integer k and a string str consisting of lowercase English alphabets, the task is to count how many k character words (with or… Read More »

Given two integers N1 and N2 where, N1 is the number of people in group 1 and N2 is the number of people in group… Read More »