C++ explained briefly
\nclass Solution {\npublic:\n /*   \n    Read (https://brilliant.org/wiki/bezouts-identity/, https://en.wikipedia.org/wiki/B\xE9zout\'s_identity)\n\nThe basic i
```\nclass Solution {\npublic:\n /*   \n    Read (https://brilliant.org/wiki/bezouts-identity/, https://en.wikipedia.org/wiki/B\xE9zout\'s_identity)\n\nThe basic idea is that for integers a and b, if gcd(a,b) = d, then there exist integers x and y, s.t a * x + b * y = d;\n\nThis can be generalized for (n >= 2) . e.g. if gcd(a,b,c) = d, then there exist integers x, y, and z, s.t, a* x + b*y + c * z = d.\n\nNow this problem is just asking if gcd(x1, ......, xn) = 1\n */   \n     bool isGoodArray(vector<int>& A) {\n        int res = A[0];\n        for (int a: A)\n            res = gcd(res, a);\n        return res == 1;\n    }\n};\n```
[]