Given an array nums of&nbsp;positive integers. Your task is to select some subset of nums, multiply each element by an integer and add all these numbers.&nbsp;The array is said to be&nbsp;good&nbsp;if you can obtain a sum of&nbsp;1&nbsp;from the array by any possible subset and multiplicand.

Return&nbsp;True&nbsp;if the array is good&nbsp;otherwise&nbsp;return&nbsp;False.

&nbsp;
Example 1:

Input: nums = [12,5,7,23]
Output: true
Explanation: Pick numbers 5 and 7.
5*3 + 7*(-2) = 1


Example 2:

Input: nums = [29,6,10]
Output: true
Explanation: Pick numbers 29, 6 and 10.
29*1 + 6*(-3) + 10*(-1) = 1


Example 3:

Input: nums = [3,6]
Output: false


&nbsp;
Constraints:


	1 &lt;= nums.length &lt;= 10^5
	1 &lt;= nums[i] &lt;= 10^9


class Solution:
    def isGoodArray(self, nums: List[int]) -> bool:
        def gcd(a,b):
            while a:
                a, b = b%a, a
            return b
        return reduce(gcd,nums)==1
class Solution {
    public boolean isGoodArray(int[] nums) {
        int gcd = nums[0];
        for(int i =1; i<nums.length; i++){
           gcd = GCD(gcd, nums[i]);
            if (gcd==1)
                return true;
        }
        return gcd ==1;
        
    }
    int GCD(int a, int b){
        if(b==0){
            return a;
        }
        else{
            return GCD(b, a%b);
        }
            
    }
}
class Solution {
public:
    bool isGoodArray(vector<int>& nums) {
        int gcd=0;
        for(int i=0; i<nums.size(); i++){
            gcd=__gcd(gcd,nums[i]);
        }return gcd==1;
    }
};
var isGoodArray = function(nums) {
    let gcd = nums[0]

    for(let n of nums){while(n){[gcd, n] = [n, gcd % n]}}

    return (gcd === 1)
};
Check If It Is a Good Array