Given two numbers A and B, the task is to calculate GCD of A and B. Examples: Input : A = 4, B = 6 Output : 2 Input : A = ...read more
GCD
4 postsGiven an array of size n, your task is to find the least common multiple or LCM of all the elements of the array. Examples: Input : arr = [ 8, 9, ...read more
Given first N natural numbers. Our task is to check whether is it possible to split the numbers in two sets such that absolute difference of the sum of numbers in the ...read more
Given an array (with all elements greater than 0), create a non-decreasing array by swapping 2 elements if their gcd(Greatest Common Factor) is equal to the minimum element of the array. You ...read more