check-if-it-is-a-good-array
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: O(nlog(max(nums)))\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python []\nfrom functools import reduce\n\nclass Solution(object):\n    def gcd(self, a, b):\n        # Custom GCD function using the Euclidean algorithm\n        while b:\n            a, b = b, a % b\n        return a\n    \n    def isGoodArray(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: bool\n        """\n        # Compute the GCD of the entire array using the custom gcd function\n        array_gcd = reduce(self.gcd, nums)\n        \n        # Check if the GCD is 1\n        return array_gcd == 1\n\nsol = Solution()\nprint(sol.isGoodArray([12, 5, 7, 23]))  \nprint(sol.isGoodArray([29, 6, 10]))     \nprint(sol.isGoodArray([3, 6]))          \n\n```
['Python']