Problem Brief
Plan Cuts π‘
OA
See Salesforce online assessment and hiring insights
An automated cutting machine is used to cut rods into segments. The cutting machine can only hold a rod of minLength or more. A rod is marked with the necessary cuts and their lengths are given as an array in the order they are marked. Determine if it is possible to plan the cuts so the last cut is from a rod at least minLength units long.
1Example 1
Input
rodLengths = [3, 5, 4, 3], minLength = 9
Output
"Possible"
Explanation
N/A for now πππ
2Example 2
Input
rodLengths = [4, 3, 2], minLength = 7
Output
"Possible"
Explanation
N/A for now
3Example 3
Input
rodLengths = [4, 2, 3], minLength = 7
Output
"Impossible"
Explanation
N/A for now
4Example 4
Input
rodLengths = [5, 6, 2], minLength = 12
Output
"Impossible"
Explanation
N/A for now
Constraints
Limits and guarantees your solution can rely on.
Unknown for now π₯²