Skip to content

Tag Archives: GCD-LCM

Given an array arr[] of N integers and Q queries of the form (l, r). The task is to find the number of distinct pairs… Read More
Given an array arr[] containing N positive integers and two variables L and R indicating a range of integers from L to R (inclusive). The… Read More
Given an array arr[] of N integers, the task is to find an integer X such that the integers that are divisible by X and… Read More
Given a positive integer N, the task is to find a triple of three distinct positive integers (X, Y, Z) such that X + Y… Read More
Given an array arr[] of size n, The task is to find the GCD of the highest and lowest frequency element in the given array.… Read More
Given two integers P and Q, the task is to find any two integers whose Greatest Common Divisor(GCD) is P and the difference between their… Read More
Given an Integer as N, the task is to convert N into two numbers a and b, such that a < b and GCD(a, b)… Read More
Given an array arr[]. The task is to create the smallest K digit number divisible by all numbers of arr[]. Examples: Input: arr[] = {2,… Read More
Given a sequence Y of size N where:  Yi = gcd(X1, X2, X3, . . ., Xi ) of some sequence X.  The task is… Read More
Given two strings A and  B, the task is to find the shortest string which is some multiple of both A and B. A string… Read More
Given an array arr[] of size N and an integer K. The task is to find the largest K digit number divisible by all number… Read More
Given an integer N, the task is to find a sequence of N distinct positive integers such that the Greatest Common Divisor of the sequence… Read More
Given an array arr[], the task is to check if it is possible to sort the given array using any number of operations where at… Read More
Given an array arr[] of N positive integers, the task is to find the minimum number of operations required to make the GCD of array… Read More
Given an integer array arr[] of N integers, the task is to make each adjacent pair in the array co prime, by adding minimum number of… Read More

Start Your Coding Journey Now!