Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# This is not my solution, the snippet is copied from the link below.
# https://leetcode.com/problems/check-if-it-is-a-good-array/discuss/419368/JavaC%2B%2BPython-Chinese-Remainder-Theorem
def isGoodArray(self, A):
gcd = A[0]
for a in A:
while a:
gcd, a = a, gcd % a
return gcd == 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.