Plan Cuts

Problem Overview

  • Determine if the marked cuts on a rod can be planned so the final cut occurs on a rod at least minLength units long.
  • Input: array of cut lengths in marked order and an integer minLength; Output: true/false feasibility.
  • Domain: manufacturing and machine scheduling for an automated cutting machine that holds rods of minLength or more.
  • A practical coding interview problem and interview question from Salesforce interviews.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: