[C++] | Explained | Faster than 90%
In order to solve the problem, we need to search more about the first hint:\n\nEq. ax+by=1 has solution x, y if gcd(a,b) = 1.\n\nif we found ANY two numbers tha
In order to solve the problem, we need to search more about the **first** hint:\n```\nEq. ax+by=1 has solution x, y if gcd(a,b) = 1.\n```\nif we found **ANY two numbers** that has a ` gcd(a,b)=1`, then ANY added numbers won\'t change the fact that gcd will results at max of 1! \nthat is :`gcd(a,b,c,d,e)=1 if gcd(a,e)=1`\nSo find If that\'s possible and **return if that\'s possible**.\n```\nint gcd(int a, int b)\n{\n    if (a == 0)\n        return b;\n    return gcd(b%a, a);\n}\npublic:\n    bool isGoodArray(vector<int>& nums) {\n        int n=nums.size();\n        int prevGCD=nums[0];\n        for(int i=1;i<n;i++)\n        {prevGCD=gcd(prevGCD,nums[i]);\n        }\n        return prevGCD==1;\n    }\n```\nIf you **like** my explanation, **hit** the **Upvote**  button and If you **don\'t**, **hit** the **Downvote** \uD83E\uDD73\nand If you have ANY questions, feel free to ask them down below \uD83D\uDC47
[]