Knowee
Questions
Features
Study Tools

2391. Minimum Amount of Time to Collect GarbageMedium78786CompaniesYou are given a 0-indexed array of strings garbage where garbage[i] represents the assortment of garbage at the ith house. garbage[i] consists only of the characters 'M', 'P' and 'G' representing one unit of metal, paper and glass garbage respectively. Picking up one unit of any type of garbage takes 1 minute.You are also given a 0-indexed integer array travel where travel[i] is the number of minutes needed to go from house i to house i + 1.There are three garbage trucks in the city, each responsible for picking up one type of garbage. Each garbage truck starts at house 0 and must visit each house in order; however, they do not need to visit every house.Only one garbage truck may be used at any given moment. While one truck is driving or picking up garbage, the other two trucks cannot do anything.Return the minimum number of minutes needed to pick up all the garbage.

Question

  1. Minimum Amount of Time to Collect GarbageMedium78786CompaniesYou are given a 0-indexed array of strings garbage where garbage[i] represents the assortment of garbage at the ith house. garbage[i] consists only of the characters 'M', 'P' and 'G' representing one unit of metal, paper and glass garbage respectively. Picking up one unit of any type of garbage takes 1 minute.You are also given a 0-indexed integer array travel where travel[i] is the number of minutes needed to go from house i to house i + 1.There are three garbage trucks in the city, each responsible for picking up one type of garbage. Each garbage truck starts at house 0 and must visit each house in order; however, they do not need to visit every house.Only one garbage truck may be used at any given moment. While one truck is driving or picking up garbage, the other two trucks cannot do anything.Return the minimum number of minutes needed to pick up all the garbage.
...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

I'm sorry, but you didn't provide a text for me to respond to. Could you please provide the text?

Similar Questions

You are given a 0-indexed array of strings garbage where garbage[i] represents the assortment of garbage at the ith house. garbage[i] consists only of the characters 'M', 'P' and 'G' representing one unit of metal, paper and glass garbage respectively. Picking up one unit of any type of garbage takes 1 minute.You are also given a 0-indexed integer array travel where travel[i] is the number of minutes needed to go from house i to house i + 1.There are three garbage trucks in the city, each responsible for picking up one type of garbage. Each garbage truck starts at house 0 and must visit each house in order; however, they do not need to visit every house.Only one garbage truck may be used at any given moment. While one truck is driving or picking up garbage, the other two trucks cannot do anything.Return the minimum number of minutes needed to pick up all the garbage. Example 1:Input: garbage = ["G","P","GP","GG"], travel = [2,4,3]Output: 21Explanation:The paper garbage truck:1. Travels from house 0 to house 12. Collects the paper garbage at house 13. Travels from house 1 to house 24. Collects the paper garbage at house 2Altogether, it takes 8 minutes to pick up all the paper garbage.The glass garbage truck:1. Collects the glass garbage at house 02. Travels from house 0 to house 13. Travels from house 1 to house 24. Collects the glass garbage at house 25. Travels from house 2 to house 36. Collects the glass garbage at house 3Altogether, it takes 13 minutes to pick up all the glass garbage.Since there is no metal garbage, we do not need to consider the metal garbage truck.Therefore, it takes a total of 8 + 13 = 21 minutes to collect all the garbage.

How much trash has Mr. Trash Wheel collected?

Which of the following is the valid min heap?

If the main body of the purse requires four major sequenced steps, then based on the information below, what is the critical path time? Process A: 14 minutesProcess B: 2 minutesProcess C: 6 minutesProcess D: 11 minutesMultiple Choice25 minutes14 minutes2 minutes33 minutes35 minutes

An assembly housing company (like Space4) receives orders to assemble some external house structures. It is currently assembling an average of 25 exteriors every 12 weeks. There are 20 pending assemblies. The sum total of all activities that are required to assemble the exterior is 10 weeks. What is the throughput time of the process?Group of answer choices12 weeks10.5 weeks9.6 weeks8.4 weeks

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.