We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int count = 0;
List factorsOfAarray = new();
int minimumb = b.Min();
for (int i = a.Max(); i <= minimumb; i++)
{
bool remainderOperator = true;
foreach (var element in b)
{
if (element % i != 0)
{
remainderOperator = false;
}
}
if (remainderOperator)
{
bool factorsOfinteger = true;
foreach (var elementina in a)
{
if (i % elementina != 0)
{
factorsOfinteger = false;
}
}
if (factorsOfinteger)
{
count += 1;
}
}
}
Console.WriteLine(count)
Cookie support is required to access HackerRank
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 →
Code in C#