Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with this simple Python coding problem, thanks!! 3. Calendar Chaos Description: Scheduling can be hard. You've realized after looking at your calendar that

Please help with this simple Python coding problem, thanks!!

image text in transcribed

image text in transcribed

image text in transcribed

3. Calendar Chaos Description: Scheduling can be hard. You've realized after looking at your calendar that you could simplify your very busy, very long day by re-organizing it so that your meetings with a single person throughout the day are instead combined into long, singular meetings. To help, you've separated your day into several equal-sized chunks. You're not the only one with a busy schedule though, your coworkers are busy too! They've provided their availability for your scheduling convenience. You notice that some weren't even available for your original meeting time! To prevent confusion, you'd also like to preserve the order that you see people for the first time throughout the day, if possible given your coworker's availabilities. For example, if you would see John first, then Mary, and then John again, you'd like to see John first and then Mary. Please write a function to reorder your schedule according to these constraints. Your function will be given an array of names representing your current schedule broken up into equal chunks of time. You will also be provided an array of arrays, each subarray containing a name in the original calendar, that person's starting in the original calendar, that person's starting availability (inclusive), and their ending availability (exclusive). Availabilities are meant to be human-readable and start at 1. The test cases are checking for both correctness and time complexity. Examples: Input: ['John', 'Mary', 'John', 'Peter', 'Susan', 'Peter'] Input: [['John', 2, 4], ['Mary', 1, 5], ['Peter', 5, 7], ['Susan', 3, 7]] Output: [ ['Mary', 'John', 'John', 'Susan', 'Peter', 'Peter'] Explanation: We'd like to see John first, but he isn't available so we see Mary first instead. Peter is similarly not available at his original time, so we see Susan first. Language Python 3 (i) Q Autoco

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions