Company: nagarro_18aug
Difficulty: medium
Need for Speed Problem Description You are entering an unrestricted street race where the trophy goes to whoever reaches the finish line first. A network of routes links a set of cities together. Along the way you might run into nitro boosters, patches of sand, crash sites, or police checkpoints. Traveling between two cities along a route always takes one hour. Picking up a nitro booster doubles your speed for your next two routes. Driving through sand halves your speed for your next two routes. A crash site is a route where collisions happen often, and getting through one safely still takes one hour. Running into a police checkpoint on any route means you get arrested on the spot and cannot continue. You are given the number of cities N, an array describing the special effect tied to each city, the total number of routes R, and an R-by-2 array listing the routes available for traveling between cities. Your task is to find and return an integer array giving a path that reaches city (N-