Given an array arr[] of N integers and a positive integer K, the task is to check if it is possible to split this array into distinct contiguous subarrays such that the Greatest Common Divisor of all elements of each subarray is greater than K....
Given an array arr[] of size N, the task is to print the minimum count of equal length subsets the array can be partitioned into such that each subset contains only a single distinct element...
Given an array arr[] of size N, the task is to check if it is possible to split the array arr[] into different subsequences of equal size such that each element of the subsequence are equal. If found to be true, then print “YES”. Otherwise, print “NO”....
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 such that in each operation divide X or Y by one of its prime factor less than M. If it is not possible to make X and Y equal, then print “-1”....
Given an array, arr[] consisting of N positive integers, the task is to make the array non-decreasing by swapping pairs (arr[i], arr[j]) such that i != j (1 ≤ i, j ≤ n) and GCD(arr[i], arr[j]) is equal to the minimum element present in the array....
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 the two strings. If no such string exists, then print -1....
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 0 by adding or subtracting A or B....
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 the array does not contain any unique elements, then print “-1“....
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to maximize the GCD of the array arr[] by either increasing or decreasing any array element by K....
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 assigned to each node, the task is to find the maximum GCD among the GCD of all connected components in the graph....
Given an array arr[] of size N, the task is to find the minimum count of elements required to be inserted into the array such that the absolute difference of all possible pairs exists in the array....
Given an array, arr[] of size N, the task is to print the GCD of all subarrays of size K....