## HCF of array of fractions (or rational numbers)

Given a fraction series. Find the H.C.F of a given fraction series. Examples: Input : [{2, 5}, {8, 9}, {16, 81}, {10, 27}] Output :… Read More »

Given a fraction series. Find the H.C.F of a given fraction series. Examples: Input : [{2, 5}, {8, 9}, {16, 81}, {10, 27}] Output :… Read More »

Give a positive integer n, find modular multiplicative inverse of all integer from 1 to n with respect to a big prime number, say, ‘prime’.… Read More »

Given an array of rational numbers, the task is to find the LCM of these numbers. Examples: Input : vect[] = {2/7, 3/14, 5/3} Output… Read More »

Given two Rational numbers, the task is to find the maximum of given two rational numbers. Examples : Input : first = 3/4, second= 3/2… Read More »

HCF (Highest Common Factor) or GCD (Greatest Common Divisor) of two numbers is the largest number that divides both of them. For example GCD of… Read More »

Given x, y, z and n, find smallest n digit number which is divisible by x, y and z. Examples: Input : x = 2,… Read More »

Given an array of N elements, find the minimum number of insertions to convert the given array into a co-prime array. Print the resultant array… Read More »

Given two positive numbers x and y. Find the maximum valued integer a such that: a divides x i.e. x % a = 0 a… Read More »

Fermat’s little theorem states that if p is a prime number, then for any integer a, the number a p – a is an integer… Read More »

Given three numbers, our task is to find the largest number by which when given 3 numbers are divided leads to same remainder. It may… Read More »

Given a list of N numbers, Find two numbers such that the product of the two numbers has the maximum number of factors. Formally given… Read More »

Given an array of n elements perform, we need to minimize array sum. We are allowed to perform below operation any number of times. Choose… Read More »

Given an array of n non-negative integers. Find such element in the array, that all array elements are divisible by it. Examples: Input : arr[]… Read More »

Given an array A[] of size N. You can replace any number in the array with the gcd of that element with any of its… Read More »

Given an array of n integers. The array is considered best if GCD of all its elements is greater than 1. If the array is… Read More »