Python Forum

Full Version: Python Exercise
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Could you please help me solve the below problem..?

As a network provider you are extending your network to different cities and you have to estimate the cost which will be incurred in huge shift.

Find the accurate range of cost of spreading out optical fibers from one office to another.

Input specification.

Input1: No of office you are planning to build
Input2: The max no of paths you are planing to build between the two offices
Input3: Array representing the starting point of the path
Input4: Array representing the ending point of the path
Input5: Array representing the cost of constructing the network
Input6: The main building where the construction would start

Output specification:

Return an array as{a,b} where as a is the mininmum cost b is the maximum cost.


Example:

Input1: 3
Input2: 3
Input3: {1,2,1}
Input4: {3,3,2}
Input5: {5,2,5}
Input6: 1

Output : {7,10}

Explanation:

Min cost would be 7 when we choose (1-2, 2-3) or (1-3, 3-2) and max cost would be 10 when we select (3-1, 1-2)


Please help me in this
What have you tried ? Post your code in proper code tags.
We will not solve your code, but we will indeed help you