You are viewing a single comment's thread. Return to all comments →
public static int getTotalX(List a, List b) {
int counter = 0; if (a.Count>=1 && a.Count <= 10 && b.Count>=1 && b.Count <= 10) { int max1 = a.Max(x => x); int max2 = b.Max(x => x); int min1 = a.Min(x => x); int min2 = b.Min(x => x); int MaxCondition = max1 > max2 ? max1 : max2; int minCondition = min1 > min2 ? min2 : min1; for (int i = minCondition; i <=MaxCondition && i<=100; i++) { if (a.All(x => i % x == 0) && b.All(y => y % i == 0)) { counter++; } } } return counter; }
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 →
public static int getTotalX(List a, List b) {