You are viewing a single comment's thread. Return to all comments →
C# Solution:
public static int getTotalX(List<int> a, List<int> b) { int maxA = a[a.Count - 1], minB = b[0], count = 0; for (int i = maxA; i <= minB; i++) { bool sw = true; foreach (int j in a) { if (i % j != 0) { sw = false; break; } } foreach (int k in b) { if (k % i != 0) { sw = false; break; } } if (sw == true) count++; } return count; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Between Two Sets
You are viewing a single comment's thread. Return to all comments →
C# Solution: