new line of code
void Simplify(int [] numbers)
{
int gcd = GCD(numbers);
for (int i = 0; i < numbers.Length; i++)
numbers[i] /= gcd;
}
int GCD(int a, int b)
{
while (b>0)
{
int rem = a % b;
a = b;
b = rem;
}
return a;
}
int GCD(int[] args)
{
return args.Aggregate((gcd, arg) => GCD(gcd, arg));
}
}
}
cant seem to get this to work any suggestions on where i could place this Thanks