Java Solution
\nclass Solution {\n    // O(N) Time | O(1) Space\n    // If GCD of all the elements is 1, the array is a good array\n    \n    public boolean isGoodArray(int[]
```\nclass Solution {\n    // O(N) Time | O(1) Space\n    // If GCD of all the elements is 1, the array is a good array\n    \n    public boolean isGoodArray(int[] nums) {\n        int result = 0;\n        for (int element: nums){\n            result = gcd(result, element);\n            if(result == 1)\n            {\n               return true;\n            }\n        }\n        return false;\n    }\n    \n    int gcd(int a, int b) {\n        if(a == 0) {\n            return b;\n        }\n        return gcd(b % a, a);\n    }\n}\n```
[]