public bool IsValid() { int numberOfSantas = Santas[0].GetLength(0); int numberOfDays = Santas.Length; int numberOfVisits = VisitsDuration.Length; return(true && Santas.All(day => day.GetLength(0) == numberOfSantas) && Santas.Zip(Visits, (a, b) => Tuple.Create(a, b)).All(e => e.Item1.GetLength(1) == e.Item2.GetLength(1)) && Santas.Length == numberOfDays && VisitsDuration.Length == numberOfVisits && Visits.All(v => v.GetLength(0) == numberOfVisits) && Distances.GetLength(0) == numberOfVisits && Distances.GetLength(1) == numberOfVisits ); }