C++ || gcd || Easy to understand
\nclass Solution {\npublic:\n    bool isGoodArray(vector<int>& nums) {\n        //using diophantine equation approach\n        //we have to select subset which 
```\nclass Solution {\npublic:\n    bool isGoodArray(vector<int>& nums) {\n        //using diophantine equation approach\n        //we have to select subset which has gcd of 1\n        //so we have to give only whether we are able to select such subset that has gcd=1\n        //so if such subset has gcd = 1 so the all element has also gcd having 1. if all element having gcd than only can return true otherwise return false\n        int g = nums[0];\n        for(auto i:nums){\n            g = __gcd(g,i);\n        }\n        if(g==1) return true;\n        else return false;\n    }\n};\n```
['C']