public USchedule[] Build()
        {
            if (MinFinancialHours > MaxFinancialHours)
            {
                throw new Exception($"{nameof(MinFinancialHours)} can't be >= {nameof(MaxFinancialHours)}.");
            }
            if (MinStartTime > MaxStartTime)
            {
                throw new Exception($"{nameof(MinStartTime)} can't be >= {nameof(MaxStartTime)}.");
            }
            if (MinEndTime > MaxEndTime)
            {
                throw new Exception($"{nameof(MinEndTime)} can't be >= {nameof(MaxEndTime)}.");
            }
            if (Days.Count == 0)
            {
                throw new Exception($"There must be at least one day in collection {nameof(Days)}");
            }
            if (Classes.Count == 0)
            {
                throw new Exception($"There must be at least one class in collection {nameof(Classes)}");
            }


            _buildClasses = Classes
                            .Where(c => c.Days.Except(Days.AsEnumerable()).Any() == false)
                            .Where(c => c.StartTime >= MinStartTime && c.EndTime <= MaxEndTime)
                            .Where(c => Breaks.Where(b => c.Intersects(b)).Any() == false)
                            .OrderBy(a => a.StartTime).ToArray();
            _builtSchedules   = new List <USchedule>();
            _buildingSchedule = new USchedule();
            BuildFrom(0);

            var result = _builtSchedules
                         //Filter the schedules and take the ones that fit our conditions
                         .Where(s => s.HasCourses(ObligatoryCourses))
                         .Where(s => s.FirstStartTime >= MinStartTime && s.FirstStartTime <= MaxStartTime)
                         .Where(s => s.LastEndTime >= MinEndTime && s.LastEndTime <= MaxEndTime)

                         .OrderBy(c => c.Days.Count())
                         .ThenBy(c => c.MaximumBreaksTotal)
                         .ThenByDescending(c => c.FinancialHours)
                         .ThenByDescending(c => c.FirstStartTime)
                         .ThenBy(c => c.LastEndTime)
                         .ToArray();

            _builtSchedules.Clear();
            _buildClasses     = null;
            _buildingSchedule = null;
            return(result);
        }