You are given a garbage, where garbage[i] represents the assortment of garbage at the garbage[i] represents one unit of garbage: 'M' for metal, 'P' for paper, and 'G' for glass. Collecting any single unit of garbage takes
You are also given a travel, where travel[i] denotes the number of minutes required to travel from house i to house i + 1.
There are
Return the minimum total number of minutes required to collect all the garbage from all houses.
Constraints:
garbage.length
garbage[i] consists of only the letters 'M', 'P', and 'G'.
garbage[i].length
travel.length garbage.length
travel[i]
You are given a garbage, where garbage[i] represents the assortment of garbage at the garbage[i] represents one unit of garbage: 'M' for metal, 'P' for paper, and 'G' for glass. Collecting any single unit of garbage takes
You are also given a travel, where travel[i] denotes the number of minutes required to travel from house i to house i + 1.
There are
Return the minimum total number of minutes required to collect all the garbage from all houses.
Constraints:
garbage.length
garbage[i] consists of only the letters 'M', 'P', and 'G'.
garbage[i].length
travel.length garbage.length
travel[i]