Given an array arr[] of size N. The task is to find whether it is possible to make Binary Search Tree with the given array… Read More

# Tag Archives: GCD-LCM

Given an array of N numbers, the task is to count the number of subsequences that have gcd equal to 1. Examples: Input: a[] =… Read More

Given an arr[], the task is to find the maximum length of the sub-array such that the LCM of the sub-array is equal to the… Read More

Given an array arr[], the task is to find the smallest perfect square which is divisible by all the elements of the given array.Examples: Input:… Read More

Given an array arr[], the task is to find the smallest perfect cube which is divisible by all the elements of the given array.Examples: Input:… Read More

Given two numbers A and B, the task is to Divide the two numbers A and B by their common divisors. The numbers A and… Read More

Given two integer and , the task is to find the count of common factors of two numbers where factors are prime.Examples: Input: A = 6, B… Read More

Given N numbers and two numbers L and R, the task is to print the count of numbers in the range [L, R] which are… Read More

Given an integer n, the task is to find the sum: LCM(1, n) + LCM(2, n) + LCM(3, n) + … + LCM(n, n) where LCM(i,… Read More

Given integers k, d1, d2 and an integer array arr[]. Starting from number k you are allowed to make jumps of size d1 and d2… Read More

Given an array of N integers and 3 integers D, A and B. The task is to find the number of array elements that we… Read More

Given an array of integers. Find an integer X which is the divisor of all except for exactly one element in the given array.Note: The… Read More

Given N integers with unknown values (ai > 0) having product P. The task is to find the maximum possible greatest common divisor of these… Read More

Given two integer p and q, the task is to find the minimum possible number x such that q % x = 0 and x… Read More

Given an array arr[] of integers, the task is to find the LCM of all the elements of the array modulo M where M =… Read More