Check If It Is a Good Array LeetCode solution in Python

1
# Runtime: 527 ms (Top 22.03%) | Memory: 24.7 MB (Top 71.19%)
2
class Solution:
3
def isGoodArray(self, nums: List[int]) -> bool:
4
def gcd(a, b):
5
while a:
6
a, b = b % a, a
7
return b
8

9
return reduce(gcd, nums) == 1

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0