Bézout's identity (GCD calculation)
Based on B\xE9zout\'s identity,\nFor ints a and b, if gcd(a,b) = d, then there exists some x, y with a * x + b * y = d;\n\ncsharp\npublic bool IsGoodArray(int[]
Based on [B\xE9zout\'s identity](https://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity),\nFor ints a and b, if gcd(a,b) = d, then there exists some x, y with a * x + b * y = d;\n\n```csharp\npublic bool IsGoodArray(int[] nums) \n{\n\tif(nums == null || nums.Length == 0)\n\t{\n\t\treturn true;\n\t}\n\n\tif(nums.Length == 1)\n\t{\n\t\treturn nums[0] == 1;\n\t}\n\n\tint gcdResult = nums[0];        \n\tfor(int i = 1; i < nums.Length; i++)\n\t{\n\t\tgcdResult = gcd(nums[i], gcdResult);\n\t\tif(gcdResult == 1)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;        \n}\n\nint gcd(int a, int b)\n{\n\twhile(b != 0)\n\t{\n\t\tint t = b;\n\t\tb = a % b;\n\t\ta = t;            \n\t}\n\n\treturn a;\n}\n```
[]