Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Pick the packages from the heaviest to the lightest one. Rules You work in an automated factory that controls a robotic arm to move packages.
Pick the packages from the heaviest to the lightest one.
Rules
You work in an automated factory that controls a robotic arm to move packages. The arm can pick packages from the conveyor belts to form a stack of packages.
The packages are sorted from the heaviest to the lightest on each of the conveyor belts. Your objective is to pick the heaviest package among the conveyor belts to move it on a stack.
Implementation
Implement the function solveweight weight weight that takes integhs arguments: weight weight and weight These values represent the weight of the packages available on the conveyor belts with respective index and When a conveyor belt is empty, the value is
The function must return the index of the ronvevor helt that has the heaviest nackace For
Console output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started