public int GetPart1() { var constellations = new List <Constellation>(); foreach (var star in AllStars) { var constellation = new Constellation(); constellation.Stars.Add(star); constellations.Add(constellation); } while (JoinSome(constellations)) { } return(constellations.Count); }
public Constellation Join(Constellation other) { other.Stars.AddRange(Stars); return(other); }