public int NumberOfAdditionalSantas() { var additionalSantaIds = NonEmptyRoutes.Where(r => OptimizationInput.IsAdditionalSanta(r.SantaId)) .Select(r => r.SantaId) .Distinct().ToList(); return(additionalSantaIds.Count); }
public int AdditionalSantaWorkTime() { var additionalSantaIds = NonEmptyRoutes.Where(r => OptimizationInput.IsAdditionalSanta(r.SantaId)) .Select(r => r.SantaId) .Distinct().ToList(); var additionalSantaRoutes = NonEmptyRoutes.Where(r => additionalSantaIds.Contains(r.SantaId)); return(additionalSantaRoutes.Select(r => r.Waypoints.Max(wp => wp.StartTime) - r.Waypoints.Min(wp => wp.StartTime)) .Sum()); }