Minimum operations to make GCD of array a multiple of k

algorithm
greatest-common-divisor

(Team) #1

We are given an array and k, we need to find the minimum operations needed to make GCD of the array equal or multiple of k. Here an operation means either increment or decrement an array element by 1.

Read this article to explore the solution to this problem


This is a companion discussion topic for the original entry at http://iq.opengenus.org/minimum-operations-to-make-gcd-of-array-a-multiple-of-k/