Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def optimalUtilization(maxTravelDist, forwardRouteList, returnRouteList):
- temp = list()
- result = list()
- for i in range (0, len(forwardRouteList)):
- temp.append(forwardRouteList[i][1])
- for j in range(0, len(returnRouteList)):
- if (maxTravelDist - returnRouteList[j][1]) in temp:
- result.append((temp.index(maxTravelDist-returnRouteList[j][1])+1, returnRouteList[j][0]))
- return result
- def main():
- result = optimalUtilization(10000, [[1, 3000], [2, 9000], [3, 7000], [4, 10000]], [[1, 2000], [2, 3000], [3, 4000], [4, 5000]])
- print(result)
- if __name__== "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement