Back
Close

Mrs. Knuth - Part I

Statement

 Goal

This puzzle is part 1 of a multi-part Algorithm X tutorial and is meant to be done per the guidance in the following playground:

https://www.algorithm-x.com

You are free to solve this puzzle in any language you choose. While the playground demonstrations are written in Python, a reusable Algorithm X Solver is available in many different languages. By following the guidance in the playground and using the solver as intended, this puzzle should be much easier than attempting it from scratch.

Task Overview:

Mrs. Knuth, the school band teacher, has asked you to write an algorithm to generate her weekly private lesson schedule for the summer. Her availability is different from week to week, but she will always teach between 1 and 5 days per week. On each day that she teaches, she will teach between 2 and 8 hours. Because she likes consistency, she will teach the same number of hours on each day she teaches, but the actual time slots during which she is available might be different from day to day.

Mrs. Knuth is a creature of habit. Her workday starts at 8am every day and ends at 5pm with an hour break for lunch each day from noon to 1pm. Although she is at school 9 total hours every day, she might not be available to teach on some days, she might have partial teaching availability on other days or she might have a day where she teaches every free minute other than during lunch.

Mrs. Knuth is also a bit odd when it comes to music. To keep her mind fresh, she refuses to teach more than a single hour per day for any particular instrument. If she teaches 3 hours in one day, those lessons must be for 3 different instruments. If she teaches 8 hours in one day, all 8 instruments that day must be different.

Given Mrs. Knuth’s open availability and each student’s instrument and lesson availability, generate a schedule for Mrs. Knuth that allows her to work with each student one time per week and meets her quirky demands.

Note About INPUT Formatting:

Availability for Mrs. Knuth, or for any one student, is formatted as a character string using the following abbreviations for the days of the week: M, Tu, W, Th and F. An availabilityString will contain all 5 abbreviations in this same order. After each abbreviation will be between 0 and 8 integers representing the times the person is available on that day. Lessons can be taught in the morning at 8, 9, 10 and 11 and in the afternoon at 1, 2, 3 and 4. Consider the following availabilityString:

M 1 2 3 Tu W Th 8 9 F 11

This indicates the person is available on Monday at 1pm, 2pm and 3pm, on Thursday at 8am and 9am and on Friday at 11am. This person has no availability on Tuesday or Wednesday.

The only valid elements in an availabilityString are M, Tu, W, Th, F, 8, 9, 10, 11, 1, 2, 3 and 4. All elements of an availabilityString are space separated.

Note About OUTPUT Formatting:

Mrs. Knuth requires a very specific format for her calendar. Her calendar has 10 rows and 6 columns with one space between each of the 6 columns.

Column 1 is 2 characters wide. In it, rows 2 – 5 and 7 – 10 contain the hours of the days, right justified. See the example below.

Columns 2 – 6 are each 14 characters wide. The contents of each row in each column is always center justified, with the extra space being on the right when it is not possible to perfectly center justify the text. At the top of each column is the day, fully written out as Monday, Tuesday, Wednesday, Thursday or Friday. In the 6th row of columns 2 - 6 is the word LUNCH.

The remainder of columns 2 – 6 contain Mrs. Knuth’s teaching schedule. If no student is scheduled on a particular day at a particular hour, the schedule should contain 14 dashes (--------------). Wherever a student has been scheduled, the location should contain the student’s name and the student’s instrument separated by a /.

All lines of the schedule must have trailing spaces removed.
Input
Line 1: Mrs. Knuth’s teacherAvailability

Line 2: An integer numStudents

Next numStudents lines: name instrument studentAvailability
Output
10 lines: schedule per the rules above. Trailing spaces must be removed from each line.
Constraints
• 2 <= length of name <= 4.

• 4 <= length of instrument <= 9.

• numStudents = Mrs. Knuth's available hours per week.

• count of each type of instrument = count of days with hours in teacherAvailability, meaning the student roster will always contain the appropriate number of instruments to make sure no duplication of instruments on any one day is possible.

• All students have unique names.

• name and instrument do not contain any spaces.

• teacherAvailability and studentAvailability are in the availabilityString format as explained in Goal section and always valid (e.g. no duplicate hours on the same day).

• All lessons consist of 1 student with 1 instrument for 1 hour.

• Mrs. Knuth will be available to teach on at least 1 day and at most 5 days.

• teacherAvailability is guaranteed to contain the same number of hours on each teaching day.

• All test cases have a unique solution.
Example
Input
M Tu W Th 2 3 4 F
3
Ayla Trumpet M Tu W Th 2 F
Bob Drums M Tu W Th 2 3 F
Alex Tuba M Tu W Th 2 4 F
Output
       Monday        Tuesday       Wednesday       Thursday        Friday
 8 -------------- -------------- -------------- -------------- --------------
 9 -------------- -------------- -------------- -------------- --------------
10 -------------- -------------- -------------- -------------- --------------
11 -------------- -------------- -------------- -------------- --------------
       LUNCH          LUNCH          LUNCH          LUNCH          LUNCH
 1 -------------- -------------- -------------- -------------- --------------
 2 -------------- -------------- --------------  Ayla/Trumpet  --------------
 3 -------------- -------------- --------------   Bob/Drums    --------------
 4 -------------- -------------- --------------   Alex/Tuba    --------------

Tags
Algorithm XExact CoverBacktracking

Difficulty
Medium

Test cases
One Easy Day Test
Input
M Tu W Th 2 3 4 F 3 Ayla Trumpet M Tu W Th 2 F Bob Drums M Tu W Th 2 3 F Alex Tuba M Tu W Th 2 4 F
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- -------------- -------------- -------------- -------------- 9 -------------- -------------- -------------- -------------- -------------- 10 -------------- -------------- -------------- -------------- -------------- 11 -------------- -------------- -------------- -------------- -------------- LUNCH LUNCH LUNCH LUNCH LUNCH 1 -------------- -------------- -------------- -------------- -------------- 2 -------------- -------------- -------------- Ayla/Trumpet -------------- 3 -------------- -------------- -------------- Bob/Drums -------------- 4 -------------- -------------- -------------- Alex/Tuba --------------

Validator 1 Validator
Input
M Tu 9 10 11 W Th F 3 Bob Clarinet M Tu 10 11 W Th F Izzy Trumpet M Tu 11 W Th F MJ Tuba M Tu 9 W Th F
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- -------------- -------------- -------------- -------------- 9 -------------- MJ/Tuba -------------- -------------- -------------- 10 -------------- Bob/Clarinet -------------- -------------- -------------- 11 -------------- Izzy/Trumpet -------------- -------------- -------------- LUNCH LUNCH LUNCH LUNCH LUNCH 1 -------------- -------------- -------------- -------------- -------------- 2 -------------- -------------- -------------- -------------- -------------- 3 -------------- -------------- -------------- -------------- -------------- 4 -------------- -------------- -------------- -------------- --------------

One Long Day Test
Input
M Tu 8 9 10 11 1 2 3 4 W Th F 8 Ayla Trumpet M Tu 11 W Th F Alex Baritone M Tu 3 W Th F Gabe Saxophone M Tu 2 4 W Th F Jack Tuba M Tu 10 1 W Th F Noah Drums M Tu 10 W Th F Jay Flute M Tu 9 11 W Th F Abby Trombone M Tu 8 W Th F Ben Clarinet M Tu 1 4 W Th F
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- Abby/Trombone -------------- -------------- -------------- 9 -------------- Jay/Flute -------------- -------------- -------------- 10 -------------- Noah/Drums -------------- -------------- -------------- 11 -------------- Ayla/Trumpet -------------- -------------- -------------- LUNCH LUNCH LUNCH LUNCH LUNCH 1 -------------- Jack/Tuba -------------- -------------- -------------- 2 -------------- Gabe/Saxophone -------------- -------------- -------------- 3 -------------- Alex/Baritone -------------- -------------- -------------- 4 -------------- Ben/Clarinet -------------- -------------- --------------

Validator 2 Validator
Input
M Tu W Th F 8 9 10 11 1 2 3 4 8 Josh Saxophone M Tu W Th F 1 2 Liam Trombone M Tu W Th F 10 4 Leo Tuba M Tu W Th F 1 Alma Drums M Tu W Th F 8 11 Amy Clarinet M Tu W Th F 2 4 Coop Flute M Tu W Th F 11 3 Wren Trumpet M Tu W Th F 8 9 Zoey Baritone M Tu W Th F 11 2
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- -------------- -------------- -------------- Alma/Drums 9 -------------- -------------- -------------- -------------- Wren/Trumpet 10 -------------- -------------- -------------- -------------- Liam/Trombone 11 -------------- -------------- -------------- -------------- Zoey/Baritone LUNCH LUNCH LUNCH LUNCH LUNCH 1 -------------- -------------- -------------- -------------- Leo/Tuba 2 -------------- -------------- -------------- -------------- Josh/Saxophone 3 -------------- -------------- -------------- -------------- Coop/Flute 4 -------------- -------------- -------------- -------------- Amy/Clarinet

Two-Day Workweek Test
Input
M 10 11 1 2 3 4 Tu W 10 11 1 2 3 4 Th F 12 Ben Trombone M 2 Tu W 1 Th F Izzy Trumpet M 11 2 Tu W 1 Th F Rae Trombone M 10 11 2 3 Tu W 4 Th F Isla Flute M 10 Tu W 2 Th F Ella Saxophone M 10 1 2 3 Tu W 4 Th F Ayla Trumpet M 11 2 3 Tu W 3 Th F Ali Flute M 10 Tu W 10 Th F Sean Clarinet M 3 Tu W 10 11 3 4 Th F Jay Clarinet M 11 Tu W 2 3 Th F Nora Saxophone M 11 4 Tu W 4 Th F Wren Tuba M 2 4 Tu W 11 Th F Noah Tuba M 10 11 Tu W 10 4 Th F
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- -------------- -------------- -------------- -------------- 9 -------------- -------------- -------------- -------------- -------------- 10 Ali/Flute -------------- Noah/Tuba -------------- -------------- 11 Jay/Clarinet -------------- Sean/Clarinet -------------- -------------- LUNCH LUNCH LUNCH LUNCH LUNCH 1 Ella/Saxophone -------------- Ben/Trombone -------------- -------------- 2 Izzy/Trumpet -------------- Isla/Flute -------------- -------------- 3 Rae/Trombone -------------- Ayla/Trumpet -------------- -------------- 4 Wren/Tuba -------------- Nora/Saxophone -------------- --------------

Validator 3 Validator
Input
M Tu 10 11 1 2 3 4 W Th F 8 9 10 11 1 2 12 Doug Flute M Tu 11 1 W Th F 1 Kate Trumpet M Tu 10 11 W Th F 11 Mia Clarinet M Tu 11 1 2 W Th F 8 Luke Drums M Tu 11 1 3 4 W Th F Amy Clarinet M Tu 2 4 W Th F 9 JT Trumpet M Tu 1 2 3 W Th F 1 Isla Tuba M Tu W Th F 10 11 Ava Tuba M Tu 11 W Th F 9 11 1 MJ Flute M Tu 10 1 W Th F 1 2 Levi Baritone M Tu 1 3 4 W Th F 9 Drew Drums M Tu 4 W Th F 9 10 1 Alma Baritone M Tu 1 2 W Th F
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- -------------- -------------- -------------- Mia/Clarinet 9 -------------- -------------- -------------- -------------- Levi/Baritone 10 -------------- Kate/Trumpet -------------- -------------- Drew/Drums 11 -------------- Ava/Tuba -------------- -------------- Isla/Tuba LUNCH LUNCH LUNCH LUNCH LUNCH 1 -------------- Doug/Flute -------------- -------------- JT/Trumpet 2 -------------- Alma/Baritone -------------- -------------- MJ/Flute 3 -------------- Luke/Drums -------------- -------------- -------------- 4 -------------- Amy/Clarinet -------------- -------------- --------------

Three Reasonable Days Test
Input
M 10 11 1 2 3 Tu W Th 9 10 11 1 2 F 11 1 2 3 4 15 Josh Baritone M 2 Tu W Th 1 2 F Sara Saxophone M Tu W Th 2 F 1 4 Mike Baritone M 3 Tu W Th 9 10 F 1 Joy Tuba M 11 Tu W Th 10 1 F 11 2 Amy Trombone M 1 Tu W Th 10 11 1 F Ali Tuba M 2 Tu W Th 10 F 3 4 Kate Trombone M 11 Tu W Th 1 2 F Lily Flute M 2 Tu W Th 9 11 2 F Zoey Tuba M 10 2 Tu W Th F 3 4 Liam Flute M 11 Tu W Th 9 2 F 1 Emma Trombone M Tu W Th 11 F 11 2 Drew Saxophone M 11 1 2 Tu W Th 1 F 2 Gabe Saxophone M 11 2 3 Tu W Th 9 F 4 Nora Baritone M 1 2 Tu W Th 10 2 F JT Flute M 2 3 Tu W Th 9 11 F 11
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- -------------- -------------- -------------- -------------- 9 -------------- -------------- -------------- Liam/Flute -------------- 10 Zoey/Tuba -------------- -------------- Joy/Tuba -------------- 11 Kate/Trombone -------------- -------------- Amy/Trombone JT/Flute LUNCH LUNCH LUNCH LUNCH LUNCH 1 Nora/Baritone -------------- -------------- Drew/Saxophone Mike/Baritone 2 Lily/Flute -------------- -------------- Josh/Baritone Emma/Trombone 3 Gabe/Saxophone -------------- -------------- -------------- Ali/Tuba 4 -------------- -------------- -------------- -------------- Sara/Saxophone

Validator 4 Validator
Input
M 10 11 1 2 3 Tu W Th 10 11 1 2 3 F 9 10 11 1 2 15 Doug Trumpet M 2 3 Tu W Th F 9 Jo Baritone M Tu W Th 10 1 F 1 Joe Trumpet M 11 1 2 3 Tu W Th F Rae Clarinet M 10 1 Tu W Th 10 F Ella Clarinet M Tu W Th 1 2 F 10 Mae Saxophone M 10 2 Tu W Th 10 1 F Noah Clarinet M 1 Tu W Th 10 F 11 Sean Saxophone M 10 1 3 Tu W Th 3 F 9 Ali Trumpet M 11 2 Tu W Th 3 F Jack Trombone M 10 3 Tu W Th 2 F 9 1 Cora Saxophone M 10 Tu W Th 1 3 F 10 1 Leo Baritone M 10 Tu W Th F 9 2 Abby Baritone M 11 1 Tu W Th 10 11 F 11 Luna Trombone M 10 11 Tu W Th 1 F 9 2 Zara Trombone M 11 3 Tu W Th 1 2 F 9
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- -------------- -------------- -------------- -------------- 9 -------------- -------------- -------------- -------------- Doug/Trumpet 10 Leo/Baritone -------------- -------------- Mae/Saxophone Cora/Saxophone 11 Zara/Trombone -------------- -------------- Abby/Baritone Noah/Clarinet LUNCH LUNCH LUNCH LUNCH LUNCH 1 Rae/Clarinet -------------- -------------- Ella/Clarinet Jo/Baritone 2 Joe/Trumpet -------------- -------------- Jack/Trombone Luna/Trombone 3 Sean/Saxophone -------------- -------------- Ali/Trumpet -------------- 4 -------------- -------------- -------------- -------------- --------------

Three Long Days Test
Input
M 9 10 11 1 2 3 4 Tu 9 10 11 1 2 3 4 W Th F 8 9 10 11 1 2 3 21 Bo Trumpet M Tu 11 W Th F 10 2 Kai Baritone M 9 2 Tu W Th F 2 Dave Tuba M 3 4 Tu W Th F 3 Noah Flute M 9 Tu 9 11 1 W Th F 10 Luna Saxophone M 2 Tu 3 4 W Th F Ben Saxophone M 10 Tu 1 3 W Th F Isla Flute M 3 Tu 11 W Th F 2 Ella Clarinet M 9 11 Tu 3 W Th F 11 Adam Clarinet M 10 1 Tu 3 W Th F 1 Bob Drums M 9 1 Tu 3 W Th F 3 Sara Saxophone M 11 Tu 4 W Th F 8 1 Cole Baritone M 11 2 Tu 2 4 W Th F 2 Ava Drums M Tu 10 3 W Th F 10 2 Mae Trumpet M 9 Tu 9 W Th F 10 Anna Tuba M 9 11 Tu 10 W Th F Coop Clarinet M 1 2 4 Tu 11 4 W Th F Mia Tuba M 1 4 Tu 3 W Th F 9 11 Rae Flute M 11 4 Tu 9 W Th F 9 1 Ayla Baritone M 1 Tu 11 W Th F 8 Levi Trumpet M Tu 9 11 W Th F 9 11 Olly Drums M 4 Tu W Th F 10 11 2
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- -------------- -------------- -------------- Ayla/Baritone 9 Mae/Trumpet Levi/Trumpet -------------- -------------- Mia/Tuba 10 Ben/Saxophone Anna/Tuba -------------- -------------- Bo/Trumpet 11 Rae/Flute Coop/Clarinet -------------- -------------- Ella/Clarinet LUNCH LUNCH LUNCH LUNCH LUNCH 1 Adam/Clarinet Noah/Flute -------------- -------------- Sara/Saxophone 2 Kai/Baritone Cole/Baritone -------------- -------------- Isla/Flute 3 Dave/Tuba Ava/Drums -------------- -------------- Bob/Drums 4 Olly/Drums Luna/Saxophone -------------- -------------- --------------

Validator 5 Validator
Input
M Tu 8 9 10 11 1 2 3 W Th 9 10 11 1 2 3 4 F 9 10 11 1 2 3 4 21 Abby Clarinet M Tu 9 10 W Th 1 F 9 3 Izzy Trombone M Tu 1 W Th 3 4 F 11 Ali Flute M Tu 1 W Th 11 2 3 F 2 Amy Baritone M Tu 8 2 3 W Th 11 F 2 Gabe Clarinet M Tu W Th 10 11 4 F 10 1 Josh Drums M Tu 9 11 W Th 9 1 F Ruby Saxophone M Tu 8 W Th 4 F 10 11 Ava Baritone M Tu 1 W Th 11 2 F Isla Tuba M Tu 8 1 W Th F 11 1 4 Nora Saxophone M Tu W Th 10 F 10 11 Liam Drums M Tu 8 W Th 4 F 11 2 Cora Flute M Tu 2 W Th 2 F 10 1 4 Alma Clarinet M Tu 11 W Th 11 F 10 Sara Drums M Tu 3 W Th 10 F 11 Noah Tuba M Tu W Th 9 11 F 11 2 Cole Baritone M Tu 9 11 3 W Th 9 4 F Joe Saxophone M Tu 1 W Th 2 4 F Mike Trombone M Tu W Th 9 11 4 F 9 Sean Trombone M Tu 11 2 W Th 11 F Drew Tuba M Tu 8 W Th 10 1 2 F 9 Anna Flute M Tu 9 2 W Th 1 F 3
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- Drew/Tuba -------------- -------------- -------------- 9 -------------- Cole/Baritone -------------- Noah/Tuba Mike/Trombone 10 -------------- Abby/Clarinet -------------- Nora/Saxophone Ruby/Saxophone 11 -------------- Sean/Trombone -------------- Alma/Clarinet Liam/Drums LUNCH LUNCH LUNCH LUNCH LUNCH 1 -------------- Joe/Saxophone -------------- Josh/Drums Gabe/Clarinet 2 -------------- Cora/Flute -------------- Ava/Baritone Amy/Baritone 3 -------------- Sara/Drums -------------- Ali/Flute Anna/Flute 4 -------------- -------------- -------------- Izzy/Trombone Isla/Tuba

Four Moderate Days Test
Input
M 8 9 10 11 1 Tu 11 1 2 3 4 W 9 10 11 1 2 Th F 9 10 11 1 2 20 Nora Trombone M Tu 4 W 9 10 Th F 10 Mia Tuba M Tu 3 W 9 2 Th F 9 11 Doug Trombone M 1 Tu 2 W 11 1 Th F Luna Drums M 11 Tu 3 W 1 Th F JT Saxophone M 8 Tu 1 W Th F 10 Kai Drums M 8 11 1 Tu 2 W Th F Ivy Trombone M Tu 11 1 W 2 Th F 1 Olly Clarinet M 10 Tu 1 2 W Th F 10 2 Izzy Saxophone M 11 Tu 1 W 9 Th F 11 Sara Clarinet M 9 Tu 2 3 W Th F 9 11 Isla Tuba M 10 11 Tu W 9 Th F MJ Drums M Tu 4 W 11 1 2 Th F Lola Tuba M Tu 4 W Th F 11 1 2 Sean Saxophone M 11 Tu 11 W 10 Th F 10 2 Jim Drums M 9 Tu 11 W 2 Th F 2 Mike Saxophone M 9 Tu 3 W 9 Th F Ben Trombone M 11 1 Tu W Th F 9 1 2 Ella Tuba M 10 11 Tu 3 W 10 Th F 2 Rae Clarinet M 8 9 Tu 1 3 W 9 Th F Mae Clarinet M Tu W Th F 9 10 11 1 2
Output
Monday Tuesday Wednesday Thursday Friday 8 Kai/Drums -------------- -------------- -------------- -------------- 9 Mike/Saxophone -------------- Rae/Clarinet -------------- Mae/Clarinet 10 Olly/Clarinet -------------- Sean/Saxophone -------------- Nora/Trombone 11 Isla/Tuba Ivy/Trombone Doug/Trombone -------------- Izzy/Saxophone LUNCH LUNCH LUNCH LUNCH LUNCH 1 Ben/Trombone JT/Saxophone Luna/Drums -------------- Lola/Tuba 2 -------------- Sara/Clarinet Mia/Tuba -------------- Jim/Drums 3 -------------- Ella/Tuba -------------- -------------- -------------- 4 -------------- MJ/Drums -------------- -------------- --------------

Validator 6 Validator
Input
M 9 10 11 1 2 Tu W 10 11 1 2 3 Th 9 10 11 1 2 F 9 10 11 1 2 20 Josh Flute M Tu W 2 Th 11 2 F Emma Saxophone M 11 Tu W 10 Th F 10 1 2 Gabe Baritone M 11 Tu W 11 Th F 9 Jay Saxophone M 11 1 Tu W Th 2 F 2 Sam Saxophone M 9 Tu W 2 3 Th 9 1 F Ali Baritone M Tu W 1 3 Th F 1 Abby Flute M Tu W 2 Th 11 2 F 2 Coop Flute M 9 10 Tu W Th 10 F 9 Amy Trumpet M 11 Tu W 2 Th 9 F 1 2 Ruby Drums M 2 Tu W 3 Th F 9 Ivy Trumpet M 11 1 2 Tu W Th 10 F 1 Anna Trumpet M Tu W 11 3 Th 2 F 10 11 Mae Baritone M Tu W 10 Th 9 2 F Ella Trumpet M 10 1 Tu W 2 Th 9 F 2 Nora Drums M 11 2 Tu W 2 Th 11 F 11 Ayla Drums M 2 Tu W 10 1 2 Th F Kai Baritone M 11 Tu W 2 Th 10 1 F 2 Sara Drums M Tu W 11 1 3 Th F 2 Bob Saxophone M 9 1 Tu W 11 1 Th F 10 Doug Flute M 9 11 Tu W 10 2 Th F 10
Output
Monday Tuesday Wednesday Thursday Friday 8 -------------- -------------- -------------- -------------- -------------- 9 Coop/Flute -------------- -------------- Mae/Baritone Ruby/Drums 10 Ella/Trumpet -------------- Doug/Flute Ivy/Trumpet Emma/Saxophone 11 Kai/Baritone -------------- Gabe/Baritone Nora/Drums Anna/Trumpet LUNCH LUNCH LUNCH LUNCH LUNCH 1 Jay/Saxophone -------------- Bob/Saxophone Sam/Saxophone Ali/Baritone 2 Ayla/Drums -------------- Amy/Trumpet Josh/Flute Abby/Flute 3 -------------- -------------- Sara/Drums -------------- -------------- 4 -------------- -------------- -------------- -------------- --------------

Five Long Days Test
Input
M 8 9 10 11 1 2 3 4 Tu 8 9 10 11 1 2 3 4 W 8 9 10 11 1 2 3 4 Th 8 9 10 11 1 2 3 4 F 8 9 10 11 1 2 3 4 40 Rae Trombone M 9 Tu 4 W Th F 2 Joe Drums M 11 2 Tu W Th 10 F 9 Ivy Clarinet M 11 3 Tu W Th F 11 Doug Tuba M Tu W Th F 8 10 1 Ava Saxophone M 2 Tu 2 W 1 Th F 10 Ella Saxophone M Tu W 4 Th 9 F 1 2 Bob Drums M 11 1 3 Tu 10 W 9 Th F Cole Clarinet M Tu 9 10 W 4 Th F 10 Bo Baritone M 1 Tu 8 10 1 W 8 Th F Jay Flute M 1 Tu 10 3 W Th F Ali Trombone M 2 Tu W 4 Th 8 F 4 Nora Clarinet M 4 Tu W 11 Th F 8 10 4 JT Drums M Tu W 2 3 4 Th F Lola Clarinet M 11 Tu W 1 Th 11 F Zoey Baritone M Tu 11 1 W 4 Th F 10 Leo Saxophone M 10 Tu 1 3 W 11 Th F 1 Ben Tuba M 10 Tu 9 3 W Th 4 F Zara Baritone M 2 Tu 1 W Th 1 F 9 11 Aria Trumpet M 4 Tu 4 W Th 10 1 F 4 Drew Trumpet M 8 2 Tu 2 W 10 Th F Luna Saxophone M Tu 8 11 W Th F 10 11 3 Tony Tuba M 9 Tu 4 W Th F 1 Adam Flute M Tu 2 3 W Th 8 F Isla Tuba M 10 3 Tu W 11 Th 9 F 9 Wren Flute M Tu 10 3 W 4 Th 1 F 10 Cora Trombone M 3 Tu 8 W 2 Th F 3 4 Izzy Saxophone M Tu 9 W 11 Th 11 F 9 11 Jo Baritone M 9 2 Tu W Th F 8 1 Gabe Drums M 2 Tu 8 W 10 11 Th 9 F Luke Flute M 1 Tu 10 W 11 Th F Alex Trumpet M Tu 2 W Th F 11 4 Noah Baritone M Tu 8 W Th 2 F 2 Dave Trombone M 9 2 Tu 11 1 3 W Th F Kai Tuba M 4 Tu W 10 3 Th 11 F 4 Olly Trumpet M 8 3 Tu 11 W Th 2 F Sean Trombone M 10 Tu 1 W Th 1 3 F Alma Trumpet M 4 Tu 9 4 W 8 3 Th F Joy Clarinet M 2 Tu W 8 9 3 Th F 3 Anna Drums M Tu 9 11 W Th 1 F Sam Flute M 3 Tu 9 W Th 10 F 8
Output
Monday Tuesday Wednesday Thursday Friday 8 Olly/Trumpet Gabe/Drums Bo/Baritone Adam/Flute Sam/Flute 9 Jo/Baritone Izzy/Saxophone Joy/Clarinet Ella/Saxophone Joe/Drums 10 Leo/Saxophone Cole/Clarinet Kai/Tuba Aria/Trumpet Zoey/Baritone 11 Bob/Drums Dave/Trombone Luke/Flute Lola/Clarinet Ivy/Clarinet LUNCH LUNCH LUNCH LUNCH LUNCH 1 Jay/Flute Zara/Baritone Ava/Saxophone Anna/Drums Doug/Tuba 2 Ali/Trombone Drew/Trumpet Cora/Trombone Noah/Baritone Rae/Trombone 3 Isla/Tuba Wren/Flute Alma/Trumpet Sean/Trombone Luna/Saxophone 4 Nora/Clarinet Tony/Tuba JT/Drums Ben/Tuba Alex/Trumpet

Validator 7 Validator
Input
M 8 9 10 11 1 2 3 4 Tu 8 9 10 11 1 2 3 4 W 8 9 10 11 1 2 3 4 Th 8 9 10 11 1 2 3 4 F 8 9 10 11 1 2 3 4 40 Luke Tuba M 3 Tu 8 10 W 3 Th 1 F Kate Flute M 3 Tu W Th 3 4 F 4 Cole Trumpet M 9 1 Tu 9 W 1 Th F Sam Clarinet M 8 4 Tu W 2 Th 8 F Mike Trumpet M Tu 11 2 W Th 8 11 F 8 Bo Trumpet M 3 Tu W 1 Th 9 1 F 8 Isla Trombone M 11 Tu 11 1 2 W 1 Th F Ella Flute M Tu W 3 Th 11 1 F 2 MJ Drums M 11 Tu 3 W Th 8 F 10 3 Amy Drums M 2 Tu 1 W Th F 9 Sean Trumpet M Tu W 8 Th 10 2 3 F Jim Saxophone M 3 Tu 11 4 W Th 3 4 F Drew Tuba M 2 Tu W 9 10 2 4 Th F Mia Clarinet M 11 Tu W Th 3 F 2 Doug Baritone M 8 Tu 9 10 W Th 8 1 F Leo Baritone M Tu 8 W 11 2 Th 9 F Adam Baritone M 1 4 Tu W Th F 11 Jack Trombone M 11 Tu W 4 Th 4 F 1 Ali Baritone M 9 Tu 8 W 8 Th F Ayla Clarinet M 2 3 Tu W 2 Th F 4 Levi Clarinet M 2 Tu 4 W 8 3 Th F Luna Flute M 4 Tu W Th 10 11 F Jo Baritone M 10 2 Tu W 10 Th F 1 Nora Saxophone M Tu 10 W Th 8 4 F JT Tuba M 10 Tu W 10 2 3 Th F Wren Trumpet M 10 4 Tu 3 W Th 11 F 11 Noah Drums M 11 Tu 3 W 8 4 Th F Zoey Trombone M 10 2 Tu 9 W Th F Sara Trombone M 9 3 Tu W 4 Th 10 11 F Dave Drums M 3 Tu W 3 Th 1 F 10 Olly Trombone M Tu 9 1 W Th F 10 Rae Saxophone M Tu 1 2 W Th 2 F Liam Tuba M 1 Tu 2 W Th 9 F Tony Clarinet M 8 Tu W Th 9 F 2 Gabe Flute M Tu 11 W 8 10 Th F Ruby Flute M Tu 9 W 8 Th 8 F Lily Drums M Tu 1 W Th 2 4 F 11 2 Ryan Saxophone M 3 Tu 8 W Th 11 F 11 2 Ben Saxophone M Tu 3 W 8 Th 10 F 8 9 Izzy Tuba M Tu 4 W 10 4 Th F 3
Output
Monday Tuesday Wednesday Thursday Friday 8 Sam/Clarinet Ali/Baritone Ben/Saxophone MJ/Drums Mike/Trumpet 9 Cole/Trumpet Ruby/Flute Drew/Tuba Liam/Tuba Amy/Drums 10 JT/Tuba Luke/Tuba Gabe/Flute Sara/Trombone Olly/Trombone 11 Noah/Drums Isla/Trombone Leo/Baritone Ella/Flute Ryan/Saxophone LUNCH LUNCH LUNCH LUNCH LUNCH 1 Adam/Baritone Lily/Drums Bo/Trumpet Doug/Baritone Jo/Baritone 2 Zoey/Trombone Rae/Saxophone Ayla/Clarinet Sean/Trumpet Tony/Clarinet 3 Jim/Saxophone Wren/Trumpet Dave/Drums Mia/Clarinet Izzy/Tuba 4 Luna/Flute Levi/Clarinet Jack/Trombone Nora/Saxophone Kate/Flute

Solution language

Solution

Stub generator input