示例#1
0
        private static string Part1(string[] input)
        {
            CupsCircle cups = ParseCupsCircle(input);

            cups.DoMoves(100);

            return(String.Join("", Array.ConvertAll(cups.GetAfter(1, 8), x => x.ToString())));
        }
示例#2
0
        private static double Part2(string[] input)
        {
            CupsCircle cups = ParseCupsCircle(input, 1000000);

            cups.DoMoves(10000000);

            double result = 1;

            foreach (int cupValue in cups.GetAfter(1, 2))
            {
                result *= cupValue;
            }

            return(result);
        }