Company: Paytm_14_jan
Difficulty: medium
Visiting Cities Problem Description There are a number of cities in a row, and there are two bus lines (Red and Blue) that go between them. Both lines visit all cities in order, but one may take longer than the other to travel between any two cities. Starting on or moving to the Blue line takes a certain amount of extra time ( blueCost ). There is no extra time required to start on or move to the Red line. Your task is to determine the minimum time to travel from the first city to each of the cities. Note: The final answer array includes the cost to reach city 0 (which is always 0), followed by the minimum costs to reach subsequent cities. Examples Example 1: Input: red = [2, 3, 4] blue = [3, 1, 1] blueCost = 2 Output: [0, 2, 5, 6] Explanation: There are 4 cities numbered 0 through 3. Times from city 0 to cities 1, 2, and 3 are at indices 0, 1, and 2 respectively in the red and blue arrays. The minimum cost to go from city 0 to itself is 0. Now ans = [0] . The time from city 0 to city