Finding subset in an array with gcd = 1