https://leetcode.com/problems/find-greatest-common-divisor-of-array/



Runtime: 77 ms, faster than 76.92% of TypeScript online submissions for Find Greatest Common Divisor of Array.

Memory Usage: 45 MB, less than 26.92% of TypeScript online submissions for Find Greatest Common Divisor of Array.



```typescript
function gcd_two_numbers(x, y) {
    //copied
  if ((typeof x !== 'number') || (typeof y !== 'number')) 
    return false;
  x = Math.abs(x);
  y = Math.abs(y);
  while(y) {
    var t = y;
    y = x % y;
    x = t;
  }
  return x;
}

function findGCD(nums: number[]): number {
    //9:26
    nums.sort(function(a, b){return a-b});
    return gcd_two_numbers(nums[0], nums.pop())
    //9:28
};
```
