Brute Force Approach || C++ ||
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n\nint gcd(int a, int b) {\n    while (b != 0) {\n        int temp = b;\n        b = a % b;\n        a = temp;\n    }\n    return a;\n}\n\n// Function to calculate GCD of an array of elements\nint findGCD(vector<int>& nums) {\n    int result = nums[0];\n    for (int i = 1; i < nums.size(); i++) {\n        result = gcd(result, nums[i]);\n        // If at any point the GCD becomes 1, we can stop early\n        if (result == 1) {\n            break;\n        }\n    }\n    return result;\n}\n\npublic:\n    bool isGoodArray(vector<int>& nums) {\n        //vector<int> subset = subsets(nums);\n        return findGCD(nums)==1;\n    }\n};\n```
['C++']