Company: Rippling_19july
Difficulty: medium
Employee Schedule Optimization Problem Description In a company, an employee receives a fixed amount, fixedPay dollars, each day they work. They also receive a bonus, bonus dollars, on a workday if they worked the day before. The employee is planning their work schedule for n days. Their schedule is given as a binary string where '1' is a workday, and '0' is not. The employee can change up to k days off ('0') to workdays ('1'). Find the maximum earnings the employee can get after changing at most k days from '0' to '1'. Function Description Complete the function getMaxEarnings in the editor with the following parameters: string schedule : initial work schedule int k : the maximum number of extra days the employee can work int fixedPay : the fixed pay for each workday int bonus : the bonus if they also worked the previous day Returns long : the maximum earnings possible long getMaxEarnings(string schedule, int k, int fixedPay, int bonus) { } Examples Example 1: Input: schedule = "10100"