Skip to content

# Tag Archives: GCD-LCM

Given an array arr[] of N elements, the task is to find the length of the smallest subarray such that when this subarray is removed… Read More
Given an array arr[] containing N elements, the task is to find the GCD of the elements which have frequency count which is a Fibonacci… Read More
Given a Binary Tree, the task is to count the nodes whose immediate children are co-prime.  Examples:  Input: 1 / \ 15 5 / \… Read More
Given a 2d-array arr[][] which represents the nodes of a Binary tree, the task is to find the maximum GCD of the siblings of this… Read More
Given two integers A and B. the task is to find the minimum number of operations required to make A and B equal. In each… Read More
Given an array arr[] of N integers. The task is to find all the common divisors of all N integers.Examples   Input: arr[] = {6, 90,… Read More
Given a positive integer N, the task is to divide it into K unique parts such that the sum of these parts is equal to… Read More
Given an array arr[] of length N, the task is the find the length of the longest sub-array with the maximum possible GCD value. Examples:  … Read More
Given a point (A, B) such that distance from each point on the curve M.y = N.x2 + O.x + P with (A, B) is… Read More
Given an array arr[] of length N, the task is to find the largest number dividing the maximum number of elements from the array. Examples: … Read More
Given an array of positive distinct integers arr[], the task is to find the final number obtained by performing the following operation on the elements… Read More
Given an array of integers, the task is to calculate the sum of GCD of all the subarrays of an array. GCD of an array… Read More
Given an array arr[] of size N > 1. The task is to find the maximum possible GCD of the array by replacing at most… Read More
Given N types of money denomination in a country as an array arr[]. A person and the shopkeeper can choose notes of each denomination any… Read More
Given an array arr[], the task is to find the count of sub-arrays with GCD equal to 1.Examples:   Input: arr[] = {1, 1, 1} Output: 6 Every… Read More