Minimum Cost to reach destination
Problem Statement:
Ram is current at city 1 and wants to reach city N. While crossing cities he can either go from city i to city 1+1 by spending
cost c_i or use a bridge that connects city i to city j ( >1). Each bridge has its own travel cost Ram doesn't likes to travel
from bridges much so he decides not to take more than k bridges during his journey
Since Ram is on a tight budget can you help Ram find out the minimum cost to reach city N.
Example
Assume that N = 3 M = 1, K = 1. c = [2,4]
Bridges
• 1 3 5
The cost of going from 1 to 3 using connections is 6. or we can use 1 bridge and go from 1 to 3 using costs. There the
answer is 5
Function description
function provided in the editor This function takes the following
Answers
Answered by
0
Answer:
xhkxhkchkchkchkhmxhkcb to go to the latest flash player is required for video playback is unavailable rights reserved privacy terms of use privacy terms in Home
Similar questions