Given an array arr[] consisting of N positive integers, the task is to sort the array arr[] according to the increasing order of GCD of… Read More

# Tag Archives: HCF

Given an array arr[] consisting of N integers and two positive integers L and R, the task is to find the farthest co-prime number in… Read More

Given three non-negative integers A, B, and C, the task is to count the numbers in the range [1, C] that can be reduced to… Read More

Given an array arr[] consisting of N positive integers, the task is to find the LCM of all unique elements of the given array. If… Read More

In this article, we will discuss the time complexity of the Euclidean Algorithm which is O(log(min(a, b)) and it is achieved. Euclid’s Algorithm: It is… Read More

Given an array arr[] size N, the task is to find the smallest number which is not co-prime with any element of the given array.… Read More

Given two integers X and Y, the task is to make X and Y equal by dividing either of X or Y by 2, 3,… Read More

Given two arrays A[] and B[], both consisting of N positive integers, an integer P and the elements of the array A[] are pairwise co-prime, the… Read More

Given two integers N and M representing the number of boys and girls, the task is to arrange them in number of different rows of… Read More

Given an array arr[] consisting of N integers and an integer X, the task is to check if it is possible to modify the array… Read More

Given two arrays A[] and B[], both of size N, the task is to generate a sequence of length N comprising elements from the two… Read More

Given two strings S and T of length N and M respectively, the task is to find the smallest string that is divisible by both… Read More

Given an integer N and a binary string consisting of 4*N number of 0s initially, the task is to flip the characters such that any… Read More

Given an undirected graph consisting of V vertices and a 2d array E[][2] denoting edges between pairs of nodes. Given another array arr[] representing values… Read More

Given three positive integers M, X, and Y, the task is to find the minimum number of operations required to make X and Y equal… Read More