Maximize Earnings by Converting Days Off to Workdays

Given an employee's schedule for n days as a binary string schedule, where '1' means a workday and '0' means a day off:

  • Every workday earns a fixed payment dailyPay.
  • A workday earns an ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: