Answer the question
In order to leave comments, you need to log in
How to keep array changes after filtering with where?
There is code that takes a sequence and removes numbers that are divisors of larger numbers in that sequence (for example, if it has 2 and 4, then you need to remove 2). It is necessary for me that if let's say one is removed from the sequence, the next time the cycle already filters the sequence without one. But every time the same sequence is filtered. Help me please. Thanks in advance.
for (int del = 1; del <= number / 2; del++)
{
Console.WriteLine("Del: " + del);
group = group.Where(x => x % del != 0);
Console.WriteLine(String.Join(" ", group));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question