protected override long ComputeResultLogic(Day16Model input)
        {
            var invalidTicketsAndSumOfInvalidValues = Day16Helper.GetInvalidTicketsAndSumOfInvalidValues(input);
            var validTickets   = input.NeighborTickets.Where(t => !invalidTicketsAndSumOfInvalidValues.Item1.Contains(t));
            var fieldsPerIndex = new Dictionary <int, IEnumerable <string> >();
            var fieldsOrder    = new string[input.FieldDefinitions.Count()];

            for (var index = 0; index < input.FieldDefinitions.Count(); index++)
            {
                var fieldValuesAtCurrentIndex = new List <int>();

                foreach (var ticket in validTickets)
                {
                    fieldValuesAtCurrentIndex.Add(ticket.TicketValues.ElementAt(index));
                }

                var validFieldsForIndex = Day16Helper.GetValidFieldsByAllValidValues(fieldValuesAtCurrentIndex, input.FieldDefinitions);
                fieldsPerIndex.Add(index, validFieldsForIndex);
            }

            var currentIndex = 0;

            while (fieldsOrder.Contains(null))
            {
                if (fieldsPerIndex[currentIndex].Count() == 1)
                {
                    fieldsOrder[currentIndex] = fieldsPerIndex[currentIndex].First();

                    Day16Helper.RemoveDuplicates(fieldsOrder[currentIndex], currentIndex, fieldsOrder.Length, fieldsPerIndex);
                }

                if (currentIndex == fieldsOrder.Length - 1)
                {
                    currentIndex = 0;
                }
                else
                {
                    currentIndex++;
                }
            }

            long fieldValuesMultiplied = 1;
            var  myTicketValues        = input.MyTicket.TicketValues.ToArray();

            for (var fieldOrderIndex = 0; fieldOrderIndex < fieldsOrder.Length; fieldOrderIndex++)
            {
                if (fieldsOrder[fieldOrderIndex].StartsWith("departure"))
                {
                    fieldValuesMultiplied *= myTicketValues[fieldOrderIndex];
                }
            }

            return(fieldValuesMultiplied);
        }
        protected override int ComputeResultLogic(Day16Model input)
        {
            var invalidTicketsAndSumOfInvalidValues = Day16Helper.GetInvalidTicketsAndSumOfInvalidValues(input);

            return(invalidTicketsAndSumOfInvalidValues.Item2);
        }