Skip to content

Instantly share code, notes, and snippets.

@planetoftheweb
Created February 21, 2025 08:16
Show Gist options
  • Save planetoftheweb/41433e9598ca7472607140860fcf43bd to your computer and use it in GitHub Desktop.
Save planetoftheweb/41433e9598ca7472607140860fcf43bd to your computer and use it in GitHub Desktop.

We need to cover a single 8-hour shift (9:00 AM–5:00 PM) every weekday, Monday through Friday. Each of the five team members has limited availability and break requirements:

  1. Alice

    • Monday: 9:00 AM–5:00 PM (needs a 1-hour lunch at some point).
    • Tuesday: 9:00 AM–1:00 PM only.
    • Wednesday: Not available.
    • Thursday: 1:00 PM–5:00 PM only.
    • Friday: 9:00 AM–3:00 PM only.
  2. Bob

    • Monday: 9:00 AM–12:00 PM, then 1:00 PM–4:00 PM (must have 12:00–1:00 PM for lunch).
    • Tuesday: 9:00 AM–5:00 PM (must take one continuous 1-hour break between 11:00 AM and 1:00 PM).
    • Wednesday: 1:00 PM–5:00 PM only.
    • Thursday: 9:00 AM–5:00 PM (no break needed).
    • Friday: Not available.
  3. Cara

    • Monday: 9:00 AM–1:00 PM only.
    • Tuesday: 1:00 PM–5:00 PM only.
    • Wednesday: 9:00 AM–5:00 PM (must take a 30-minute break sometime after 12:00 PM).
    • Thursday: 9:00 AM–12:00 PM only.
    • Friday: 9:00 AM–5:00 PM (flexible break).
  4. David

    • Monday: Not available.
    • Tuesday: 9:00 AM–5:00 PM (needs a 30-minute lunch around noon).
    • Wednesday: 9:00 AM–5:00 PM (needs a 1-hour break).
    • Thursday: 9:00 AM–5:00 PM (needs a 1-hour break).
    • Friday: 9:00 AM–12:00 PM only.
  5. Emily

    • Monday: 9:00 AM–5:00 PM (30-minute lunch flexible).
    • Tuesday: Not available.
    • Wednesday: 9:00 AM–12:00 PM only.
    • Thursday: 1:00 PM–5:00 PM only.
    • Friday: 9:00 AM–5:00 PM (needs a 1-hour lunch between 12:00 PM and 2:00 PM).

Create a Monday–Friday schedule that meets these goals:

  • Every hour from 9:00 AM to 5:00 PM is fully staffed each day.
  • No one is scheduled outside their availability.
  • All required breaks are honored.
  • No overlaps where someone is double-booked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment