Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python3 You just got a new job where you have to work exactly as many hours as you are told each week, working no more

Python3

image text in transcribed

You just got a new job where you have to work exactly as many hours as you are told each week, working no more than a daily maximum number of hours per day.Some of the days, they tell you how many hours you will work. You get to choose the remainder of your schedule, within the limits A completed schedule consists of exactly 7 digits in the range 0 to 8 representing each day's hours to be worked. You will get a pattern string similar to the schedule, but with some of the digits replaced by a question mark, ?, (ascii 63 decimal). Given a maximum number of hours you can work in a day, replace the question marks with digits so that the sum of the scheduled hours is exactly the hours you must work in a week. Return a string array with all possible schedules you can create, ordered lexicographically. For example, your partial schedule, pattern -08?2840, your required hours, work hours-24, and you can only work, at most, day_hours 4 hours per day during the two days in question. You have two days on which you must work 24-20 4 more hours for the week. All of your possible schedules are listed below: 0804840 9813840 0822846 831840 9840840 Function Description Complete the function findSchedules in the editor below. The function must return an array of strings that represents all possible valid schedules. The strings must be ordered lexicographically findSchedules has the following parameter(s) work hours: an integer that represents the hours you must work in the week day hours: an integer that represents the maximum hours you may work in a day pattern: a string that represents the partially completed schedule

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions