nums
오름차 순 정렬function findGCD(nums: number[]): number {
const sorted = nums.toSorted((a, b) => a - b)
const min = sorted[0]
const max = sorted.at(-1)
return gcd(max, min)
};
function gcd(a: number, b: number) {
if(a % b === 0) return b
return gcd(b, a % b)
}