Lowest-Cost Shirt Color Schedule
Problem statement
For each day, costs[i][0], costs[i][1], and costs[i][2] are the costs of wearing a blue, green, or red shirt. Choose exactly one shirt per day, and never choose the same color on consecutive days.
Return the unique minimum-cost color sequence using the characters b, g, and r.
Function
lowestCostShirtColors(costs: int[][]) → StringExamples
Example 1
costs = [[1,5,9],[4,2,8],[7,6,1]]return = "bgr"Choosing blue, green, then red costs 4 and is the unique optimum.
Example 2
costs = [[7,2,5]]return = "g"With one day, choose the least expensive green shirt.
Constraints
1 <= costs.length <= 10^5.costs[i].length == 3.1 <= costs[i][j] <= 10^6.- The minimum-cost valid sequence is unique.