Company: Booking holdings_9aug
Difficulty: medium
Deciding Schedule Problem Description In a company, an employee is paid a fixed amount of fixedPay dollars for every day they work. They also receive an extra bonus dollars on a workday if they also worked the day before. The employee is planning their work schedule for the next n days. The plan is given as a binary string schedule of length n , where '1' means the employee works that day and '0' means a day off. The employee may change at most k days off ( '0' ) into workdays ( '1' ). Workdays can never be changed into days off. After the changes, the earnings for each day are: a day off earns 0 ; a workday earns fixedPay , plus bonus if the previous day is also a workday in the changed schedule. Find the maximum total earnings the employee can get over the n days. Complete the function getMaxEarnings(schedule, k, fixedPay, bonus) , which returns this maximum as a 64-bit integer. Input Format Read from standard input. schedule k fixedPay bonus Line 1 contains the string schedule , mad