1250. Check If It Is a Good Array¶ Time: Space: C++ 1 2 3 4 5 6 7 8 9 10 11class Solution { public: bool isGoodArray(vector<int>& nums) { int g = nums[0]; for (const int num : nums) g = __gcd(g, num); return g == 1; } };