C++ just find two co-primes, (Bezout's identity) explained
\n// Bezout\'s identity\n// Let a and b be integers with greatest common divisor d.\n// Then, there exist integers x and y such that ax + by = d.\n// In our cas
```\n// Bezout\'s identity\n// Let a and b be integers with greatest common divisor d.\n// Then, there exist integers x and y such that ax + by = d.\n// In our case, we just have two find two numbers such that they are co-prime, i.e. their gcd=1\nclass Solution {\npublic:\n    bool isGoodArray(vector<int>& nums) {\n        int n=nums.size();\n        int g=nums[0];\n        for (int i=1;i<n;i++){\n            g=__gcd(g,nums[i]);\n\t\t\t// If there are two co-primes then the entire array is co-prime\n            if (g==1) return true;\n        }\n        return g==1;\n    }\n};\n```
[]