Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution:
- def isGoodArray(self, nums: List[int]) -> bool:
- gcd = nums[0]
- for num in nums[1:]:
- a = gcd
- b = num
- while a % b > 0:
- a, b = b, a % b
- gcd = b
- if gcd == 1:
- return True
- return gcd == 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement