It depends…are they two completely separate solutions, or are they somehow related?
If the two solutions are "two sides of the same coin", then I'd put them as a single answer. Either separate them with a horizontal rule, or—better yet—use headings (#
in markdown) to separate them.
If they are two completely separate things that have nothing to do with one another, it would probably be best to post them as separate answers. Not only is that somewhat less confusing, but more importantly, it allows the community to vote on them independently. This provides a more accurate judgment of their merits. If you'd combined them in one answer, and I thought one of them was stupid but the other was a good idea, how would I vote?
var names = new List<string>(); foreach(var person in people) { names.Add(person.Name); }
Answer 2:var names = people.Select(person => person.Name).ToList();
- both completely correct, two completely different answers.