Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. def optimalUtilization(maxTravelDist, forwardRouteList, returnRouteList):
  2. temp = list()
  3. result = list()
  4. for i in range (0, len(forwardRouteList)):
  5. temp.append(forwardRouteList[i][1])
  6.  
  7. for j in range(0, len(returnRouteList)):
  8. if (maxTravelDist - returnRouteList[j][1]) in temp:
  9. result.append((temp.index(maxTravelDist-returnRouteList[j][1])+1, returnRouteList[j][0]))
  10.  
  11. return result
  12.  
  13. def main():
  14. result = optimalUtilization(10000, [[1, 3000], [2, 9000], [3, 7000], [4, 10000]], [[1, 2000], [2, 3000], [3, 4000], [4, 5000]])
  15. print(result)
  16.  
  17. if __name__== "__main__":
  18. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement