Beispiel #1
0
        private static List <int> GetInput()
        {
            var input = Day1_Common.GetIntInput(@"./day10/input.txt");

            input.Add(0);
            input.Sort();
            input.Add(input[input.Count - 1] + 3);

            return(input);
        }
Beispiel #2
0
        public static void Task1()
        {
            Console.WriteLine("AOC2020_Day1_Task1");

            var numbers = Day1_Common.GetInput();

            for (int i = 0; i < numbers.Count; i++)
            {
                for (int j = i + 1; j < numbers.Count; j++)
                {
                    if (numbers[i] + numbers[j] == 2020)
                    {
                        Console.WriteLine("Result : {0}, {1} -> {2}", numbers[i], numbers[j], numbers[i] * numbers[j]);
                        return;
                    }
                }
            }
            Console.WriteLine("Values were not found !!!!!");
        }