## Check if an array can be formed by merging 2 non-empty permutations

Given an array arr[] of length N, the task is to check if it can be formed by merging two permutations of same or different… Read More »

- Count number of binary strings without consecutive 1’s : Set 2
- Minimum window size containing atleast P primes in every window of given range
- tgamma() method in C/C++ with Examples
- Count numbers less than N containing digits from the given set : Digit DP
- Count of interesting primes upto N
- Transform N to Minimum possible value
- Find minimum value of the expression by choosing K elements from given array
- Check if an array can be formed by merging 2 non-empty permutations
- fpclassify() method in C/C++ with Examples

Given an array arr[] of length N, the task is to check if it can be formed by merging two permutations of same or different… Read More »

Given three integers X, Y and P, the task is to find the minimum window size K such that every window in the range [X,… Read More »

Given an array of integers arr of size N, the task is to find the minimum possible of the expression by choosing exactly K(≤ N)… Read More »

Given an integer N and set of digits D[], which consists of digits from [1, 9]. The task is to count the numbers possible less… Read More »

Given two numbers and N and D. Apply any of two below operations to N: add D to N change N to digitsum(N), where digitsum(N)… Read More »

Given a number N, the task is to find the number of interesting primes less than equal to N. An interesting prime is any prime… Read More »

Given a positive integer N, the task is to count all possible distinct binary strings of length N such that there are no consecutive 1’s.… Read More »

The tgamma() function is defined in header math.h header in C and cmath library in C++. This function is used to compute the gamma function… Read More »

The fpclassify() function are defined in header math.h header in C and cmath library in C++. This function is used to get the value of… Read More »

Given a string array item[] and an integer array price[] where price[i] is the price of the item[i] when purchased from the ith shop. The… Read More »

Given three integers A, B and C. The task is to count the number of triples (a, b, c) such that a * c >… Read More »

Given an array, the task is to count the elements of array whose factors are less than the given number x. Examples: Input: arr =… Read More »

Given three integers A, B and K. Initially, the first person was ahead of the second person by K kms. In every hour, the first… Read More »

Determinant of a Matrix is a scalar property of that Matrix. Determinant is a special number that is defined for only square matrices (plural for… Read More »

Given an array Q[] of length N, the task is to find the permutation P[] of integers from the range [1, N + 1] such… Read More »