code: function getReservation(resources, start, min, max) {
      var reservation, schedules = [], delays = {},
          maxTries = 50;
  
      initRanges(resources, start, schedules, delays);
      while(!(reservation = tryReservation(schedules, min, max)).success && --maxTries) {
        updateRanges(schedules, nextValidStart(schedules), delays);
      }
  
      reservation.delays = delays;
      return reservation;
    }
docs: Attempts to find the next time that all resources are available, starting
  from the start time, with a duration of at least min minutes but no more
  than max minutes.