C++ Solution | GCD
Just check whether the GCD of all the numbers is equal to $1$, if so then we can prove that there is always a way that makes the array good according to Diophan
Just check whether the GCD of all the numbers is equal to $1$, if so then we can prove that there is always a way that makes the array good according to [Diophantine Equation](https://en.wikipedia.org/wiki/Diophantine_equation)\n\n# Code\n```\nclass Solution {\npublic:\n    bool isGoodArray(vector<int>& a) {\n        int g = 0;\n        for (int x : a) {\n            g = __gcd(g, x);\n        }\n        return g == 1;\n    }\n};\n```
['C++']