code: function isAvailable(time, duration, availabilities) {
      if (duration === 30) {
          return (availabilities.indexOf(time) !== -1);
      } else if (duration === 60) {
          const secondHalfHourTime = incrementTimeByThirtyMins(time);
          return (availabilities.indexOf(time) !== -1 && availabilities.indexOf(secondHalfHourTime) !== -1);
      }
      // Invalid duration ; throw error.  We should not have reached this branch due to earlier validation.
      throw new Error(`Was not able to understand duration ${duration}`);
  }
docs: Helper function to check if the given time and duration fits within a known set of availability windows. Duration is assumed to be one of 30, 60 (meaning minutes).  Availabilities is expected to contain entries of the format HH:MM.