Minimum Time to Collect Items from Conveyor Belt
Given a string representing a sequence of bottles ('a' for aluminum, 'b' for glass, 'c' for plastic) on a conveyor belt and an integer k, determine the minimum number of minutes required to collect at least k items of each type by picking from either end of the belt. Return -1 if impossible.
Asked at:
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Mid January, 2025
Amazon
Junior
Minimum time to collect items from conveyor belt: Given a string representing a sequence of bottles ('a' for aluminum, 'b' for glass, 'c' for plastic) on a conveyor belt and an integer k, determine the minimum number of minutes required to collect at least k items of each type by picking from either end of the belt. Return -1 if impossible.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.