c++ O(n) with explanations
Since the GCD is an associative function, we have\n* gcd(a0, a1,...,an - 1) = gcd(a0, gcd(a1,...,an-1) = gcd(gcd(a0, a1), gcd(a2,...,an-1)) = ...\n\nand so on, 
Since the GCD is an associative function, we have\n* gcd(a<sub>0</sub>, a<sub>1</sub>,...,a<sub>n - 1</sub>) = gcd(a<sub>0</sub>, gcd(a<sub>1</sub>,...,a<sub>n-1</sub>) = gcd(gcd(a<sub>0</sub>, a<sub>1</sub>), gcd(a<sub>2</sub>,...,a<sub>n-1</sub>)) = ...\n\nand so on, every possible combination is included. So we just have to iterate through `nums` until we find a gcd of `1`. In other world, if gcd(a<sub>0</sub>, a<sub>1</sub>,...,a<sub>n - 1</sub>) = 1, there exist a subsequence a<sub>i<sub>j</sub></sub> with #{a<sub>i<sub>0</sub></sub>,...,a<sub>i<sub>k</sub></sub>} = k, 1 <= k <= n, that give a gcd of `1.`\n\n```\nclass Solution {\n    \npublic:\n    \n    bool isGoodArray(vector<int>& nums) {\n        if(nums.size() == 1 and nums[0] == 1) return true;\n        int gcd = 0;\n        for(int i = 0; i < nums.size(); ++i) {\n            if(i == 0) gcd = nums[i];\n            else {\n                gcd = __gcd(gcd, nums[i]);\n                if(gcd == 1) return true;\n            }\n        }\n        return false;\n    }\n};\n```
['C']