1578. Minimum Time to Make Rope Colorful
Medium
Input: colors = "abaac", neededTime = [1,2,3,4,5]
Output:
3
Explanation:
In the above image, 'a' is blue, 'b' is red, and 'c' is green.
Bob can remove the blue balloon at index 2. This takes 3 seconds.
There are no longer two consecutive balloons of the same color. Total time = 3.Input: colors = "abc", neededTime = [1,2,3]
Output:
0
Explanation:
The rope is already colorful. Bob does not need to remove any balloons from the rope.Last updated


