C# Solution using Gcd
\n# Complexity\n- Time complexity:\nO(N log max)\n- Space complexity:\nO(1)\n# Code\n\npublic class Solution {\n    public bool IsGoodArray(int[] nums) {\n     
\n# Complexity\n- Time complexity:\nO(N log max)\n- Space complexity:\nO(1)\n# Code\n```\npublic class Solution {\n    public bool IsGoodArray(int[] nums) {\n        int gcd(int a,int b) => (a == 0) ? b : gcd(b % a, a);\n        int curGcd = nums[0];\n        for(int i = 1; i < nums.Length;i++){\n            curGcd = gcd(curGcd,nums[i]);\n            if(curGcd == 1) return true;\n        } \n        return curGcd == 1;\n    }\n}\n```
['Number Theory', 'C#']