# Tag Archives: math

## 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 »

## Minimum window size containing atleast P primes in every window of given range

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 »

## Find minimum value of the expression by choosing K elements from given array

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 »

## Count numbers less than N containing digits from the given set : Digit DP

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 »

## Transform N to Minimum possible value

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 »

## Count of interesting primes upto N

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 »

## Count number of binary strings without consecutive 1’s : Set 2

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 »

## tgamma() method in C/C++ with Examples

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 »

## fpclassify() method in C/C++ with Examples

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 »

## Minimum, maximum and average price values for all the items of given type

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 »

## Count of triples (A, B, C) where A*C is greater than B*B

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 »

## Python | Count the array elements with factors less than or equal to the factors of given x

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 »

## Number of hours after which the second person moves ahead of the first person if they travel at a given speed

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 »

## Properties of Determinants of Matrices

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 »

## Find the permutation p from the array q such that q[i] = p[i+1] – p[i]

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 »