Create two random teams from a list of players
Review


Don't use the main entry point to implement an algorithm. Create a method instead.
Think about how to allow this method to be usable for all kinds of types, not just integers. You have implemented the algorithm for integers, yet you show an example with strings.
When creating an algorithm, surely you have made some unit tests, at least for the happy paths. Feel free to include them in the question.
Use clear variable names, and stick to one written language.
Don't mix algorithm logic with Console output.


A possible method signature could be:

public static IEnumerable&lt;IEnumerable&lt;T&gt;&gt; SplitRandom&lt;T&gt;(
    this IEnumerable&lt;T&gt; source, int targetCount)
{
    // .. algorithm implementation
}


Called as..

var names = new [] { "John", "Mike", "Alice", "Bob" };
var teams = names.SplitRandom(2);


Or as..

var numbers = Enumrable.Range(1, 10);
var numberGroups = numbers.SplitRandom(2);