## Number of permutations of a string in which all the occurrences of a given character occurs together

Given a string ‘s’ and a character ‘c’, the task is to find the number of permutations of the string in which all the occurrences… Read More »

## Minimum difference between the highest and the smallest value of mines distributed

Given n companies and m oil mines having values, the task is to distribute the mines among n companies in a fair manner. That is… Read More »

## Check if two Linked Lists are permutations of each other

Given two singly Linked list of integer data. The task is to write a program that efficiently checks if two linked lists are permutations of… Read More »

## Program to calculate the value of nCr Efficiently

Given two numbers n, r ( n>=r ). The task is to find the value of C(n, r) for big value of n. Examples: Input:… Read More »

## Permutations to arrange N persons around a circular table

Given N, the number of persons. The task is to arrange N person around a circular table. Examples: Input: N = 4 Output: 6 Input:… Read More »

## Number of integral solutions of the equation x1 + x2 +…. + xN = k

Given N and K. The task is to count the number of the integral solutions of a linear equation having N variable as given below:… Read More »

## Count unique subsequences of length K

Given an array of N numbers and an integer K. The task is to print the number of unique subsequences possible of length K. Examples:… Read More »

## Print all the combinations of N elements by changing sign such that their sum is divisible by M

Given an array of N integers and an integer M. You can change the sign(positive or negative) of any element in the array. The task… Read More »

## Sudo Placement[1.3] | Final Destination

Given an array of integers and a number K with initial and final values. Your task is to find the minimum number of steps required… Read More »

## Total number of ways to place X and Y at n places such that no two X are together

Given N positions, the task is to count the total number of ways to place X and Y such that no two X are together.… Read More »

## Number of ways to form an array with distinct adjacent elements

Given three integers N, M and X, the task is to find the number of ways to form an array, such that all consecutive numbers… Read More »

## Number of triangles in a plane if no more than two points are collinear

Given n points in a plane and no more than two points are collinear, the task is to count the number of triangles in a… Read More »

## Queries of nCr%p in O(1) time complexity

Given Q queries and P where P is a prime number, each query has two numbers N and R and the task is to calculate… Read More »

## Minimum number of operations to convert a given sequence into a Geometric Progression

Given a sequence of N elements, only three operations can be performed on any element at most one time. The operations are: Add one to… Read More »

## Number of sequences which has HEAD at alternate positions to the right of the first HEAD

Given that a coin is tossed N times. The task is to find the total number of the sequence of tosses such that after the… Read More »