Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Exercise
#1
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
Reply
#2
What have you tried ? Post your code in proper code tags.
We will not solve your code, but we will indeed help you
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python exercise HY2000 2 3,208 Nov-07-2019, 08:01 AM
Last Post: HY2000
  Python exercise janaraguz 2 2,577 Sep-22-2018, 08:43 PM
Last Post: ichabod801
  Simple exercise - how to write in python tomtom55 6 4,983 Sep-28-2017, 07:18 PM
Last Post: nilamo
  Python Exercise: Generate a two-dimensional array smbx33 4 10,833 Apr-22-2017, 11:51 PM
Last Post: smbx33

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020