Redirecting to
NADOS

Minimum Cost For Tickets

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

1. You are going on a vacation for a year, you've decided certain days for travelling in the city, given to you as a strictly increasing array from day 1....365
2. There are 3 kinds of passes you can take in this city for transport:
a) A single day pass, cost of which is in an array at cost[0]
b) A week's pass, cost of which is in an array at cost[1]
c) A month's pass, cost of which is in an array at cost[2]
3. Find and return minimum amount it'll cost you for travelling in the city according to the given days
4. Input and output is handled for you
5. It is a functional problem ,please do not modify main()
Input Format
Input is handled for you
Output Format
Output is handled for you
Question Video
Constraints
array contains strictly increasing positive integers
1<=Days.length <=365
1<=Days[i]<=365
Sample Input
9
2 3 8 9 10 11 12 14 27
1 5 25
Sample Output
8


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name