Exemple #1
0
        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);
        }
Exemple #2
0
        public Constellation Join(Constellation other)
        {
            other.Stars.AddRange(Stars);

            return(other);
        }