Find Greatest Common Divisor of Array LeetCode solution in Python
1# Runtime: 282 ms (Top 5.10%) | Memory: 13.9 MB (Top 81.34%)2class Solution:3def findGCD(self, nums: List[int]) -> int:4i_min = min(nums)5i_max = max(nums)6greater = i_max7while True:8if greater % i_min == 0 and greater % i_max == 0:9lcm = greater10break11greater += 112return int(i_min / (lcm / i_max))